mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #200] DNSSEC Signature verification doesn't verify actual bytes received on the wire #390
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#390
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @briansmith on GitHub (Sep 22, 2017).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/200
While working on PR #198, I noticed that signature verification doesn't operate on the bytes received on the wire. Instead, the message is parsed, then re-serialized, and then the signature is verified using the re-serialized version. This means that potentially bugs in the serialization logic could result in security issues, if an attacker can somehow get us to "fix" a bad value during the re-serialization.
Instead, the signature should be verified on the bytes received on the wire. In particular, the
verify_message()function should go away, and the signature verification should be moved up the call chain to where theMessageis initially constructed. Or, something like that; I admit I didn't read all this code carefully.@bluejekyll commented on GitHub (Sep 23, 2017):
Nice catch.
@briansmith commented on GitHub (Oct 2, 2017):
I looked into this. Basically, the signature is in a record that must be at the very end of the DNS message. Therefore, if we know the index
iof the start of that signature record relative to the start of the whole messagem, then it would be straightforward to verify the signature over&m[..i], or so. Doing this should make the resolver slightly faster and result in less heap churning (because there would be no malloc/free), but neither effect would be too notable. The main motivation for doing this is to reduce the attack surface for the signature verifier.