-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Malformed hashes are silently loaded #205
Comments
NSD loads the data and does not inspect the data content for validity. It just serves the content to the clients. This means a lot of records, also like, DNSKEY records that could have malformed content. And the only way to know is to cast it into its verification type object, and interpret the content type. Or records loaded with unknown type syntax could have specified some different type of byte content. The nsd-checkzone utility reports if the zone can be loaded by NSD, which is okay. If you want more zone checks, utilities like ldns-verifyzone, or the ones you use, may be able to catch more errors in the zone. That said, for common, or useful, errors it could be possible to add checks where needed. But NSD just by design does not want to go into the records themselves, just send them to the client. So right now, for hashes in type DS or ZONEMD, it does not know anything about them, just loads them, unaltered. |
Adding an extra check for data length is fairly straightforward and probably a good thing to make a semantic warning. I.e., it fails to load on primary with an error and only reports a warning on secondaries. |
"Funny" the |
When NSD loads a zone from disk, and the zone has records such as DS or ZONEMD, where the hash is malformed, NSD appears to silently load the zone, including the malformed hashes, and serve them. When I query such an NSD server with BIND's dig, dig warns of a malformed packet.
The
nsd-checkzone
utility also doesn't catch this syntax error. On the other hand, BIND'snamed-checkzone
and Knot DNS'skzonecheck
both catch these errors. In the example below, both the ZONEMD record and the DS record foraaa
are malformed. They are each missing a byte.The text was updated successfully, but these errors were encountered: