-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix RootServer resolution of SYNTH and GLUE records #444
Conversation
cf0ac80
to
d09354f
Compare
rebase to bb292d8 I realized the Consider the name
Without the (newly force-pushed) patch, we wouldn't get the additional section we need to resolve the name:
This is because |
rebase to 837d4cc : fix lint |
Codecov Report
@@ Coverage Diff @@
## master #444 +/- ##
==========================================
+ Coverage 62.07% 62.21% +0.13%
==========================================
Files 129 129
Lines 34851 34849 -2
Branches 5921 5920 -1
==========================================
+ Hits 21635 21680 +45
+ Misses 13216 13169 -47
Continue to review full report at Codecov.
|
I've looked a little bit more into this and I think again the Consider the response below querying Regardless if the NS is a subdomain of the queried name or not, if the nameserver knows about glue, it will be returned in the ADDITIONAL section. Source: this helpful IRC chat
|
TODO: do we need to remove Lines 257 to 271 in 89d3ab4
|
@pinheadmz, IIRC we put the |
This paper talks a bit about the glue-not-subdomain records: http://www.nxnsattack.com/shafir2020-nxnsattack-paper.pdf It's called the Bailiwick Rule:
|
rebase to 7365b1c: rebase on master, update test and revert one of the |
SYNTH4 and SYNTH6 records are very special: they act like NS records that contain their own IP addresses, encoded in base32. They can therefore be resolved without any lookup whatsoever. It's a neat trick to save blockchain space and avoid using useless NS+glue.
This PR fixes three bugs in the hsd RootServer resolution of these records:
1)
binet.isIPv4(raw)
expectsraw
to be 16 bytesThe server does not currently map IPv4 to IPv6 addresses before proceeding with response.
Without patch:
2) cache does not properly detect the
_synth.
pseudo-TLDThe root server caches the first
_synth.
response and returns the same answer for all further queries, even though the design of the synth record is to decode the "subdomain" every time the pseudo-TLD is resolved:Without patch:
3) glue is missing from the "additional" section of the answer
Expected result: