Skip to content

Fix interpretation of TTL as UINT32 with most significant bit unset - #116

Merged
clue merged 1 commit into
reactphp:masterfrom
clue-labs:ttl
Nov 5, 2018
Merged

Fix interpretation of TTL as UINT32 with most significant bit unset#116
clue merged 1 commit into
reactphp:masterfrom
clue-labs:ttl

Conversation

@clue

@clueclue commented Nov 4, 2018

Copy link
Copy Markdown
Member

TTL is actually a UINT32 with most significant bit unset for BC reasons as per https://tools.ietf.org/html/rfc2181#section-8. This will not affect "normal" operation as the most significant bit should not be set by compliant implementations and we will now interpret this accordingly.

Refs #81
Refs #114

@clueclue added the bug label Nov 4, 2018
@clueclue added this to the v0.4.16 milestone Nov 4, 2018
@clue
clue requested review from WyriHaximus and jsorNovember 4, 2018 12:58
@kelunik

Copy link
Copy Markdown

It's probably best to limit the TTL to a much lower value, such as one day, to mitigate the effect of a successful cache poisoning attack.

@clue

clue commented Nov 4, 2018

Copy link
Copy Markdown
MemberAuthor

@kelunik I think you're raising a valid point when it comes to the caching layer (see #81). However, this PR is concerned with the networking layer. It's my understanding that this layer should therefor implement the DNS protocol specs as suggested in this PR.

@kelunik

Copy link
Copy Markdown

@kelunik Indeed, the policy for that shouldn't live in the parser.

jsor
jsor approved these changes Nov 5, 2018
@clue
clue merged commit 6f2f761 into reactphp:masterNov 5, 2018
@clue
clue deleted the ttl branch November 5, 2018 08:54
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@clue@kelunik@jsor@WyriHaximus