mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #3349] [MERGED] Better NSEC and NSEC3 wildcard expansion validation #3765
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#3765
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?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/3349
Author: @marcus0x62
Created: 11/14/2025
Status: ✅ Merged
Merged: 11/25/2025
Merged by: @marcus0x62
Base:
main← Head:nsec-nsec3-wildcard-validation📝 Commits (10+)
2ede286server: return covering NSEC records for wildcard requests62e94cbserver: expand rrsig name for wildcard expanded recordsd03c604proto: return Option<&Name> in find_soa_name811ed4eproto: make SOA name optional in verify_nsec7c59271proto: unit tests for verify_nsecab54f26proto: NSEC verification for wildcard expansion responsesf2b1b29tests: only look for NSEC records in authorities sectiond76963ctests: apply invalid nsec teste4c52d2proto: closer wildcard verification for NSEC responses9e1a93bproto: make SOA argument optional in NSEC3 verification📊 Changes
6 files changed (+1618 additions, -393 deletions)
View changed files
📝
crates/proto/src/dnssec/handle.rs(+831 -83)📝
crates/proto/src/dnssec/nsec3.rs(+741 -277)📝
crates/server/src/store/in_memory/inner.rs(+5 -1)📝
crates/server/src/zone_handler/catalog.rs(+39 -29)📝
tests/integration-tests/tests/integration/invalid_nsec3_tests.rs(+0 -1)📝
tests/integration-tests/tests/integration/invalid_nsec_tests.rs(+2 -2)📄 Description
Addresses #2882 - insufficient validation of wildcard expanded positive responses. So, high level, this required the following changes:
Not strictly necessary, but:
I found two separate implementations of the closest encloser proof in the NSEC3 code, each with a commingled wildcard proof (one for NXDomain responses, one for no data responses.) I simplified that into one implementation of the closest encloser proof and broke out the wildcard proof into a separate function.
Around 1,100 lines of this PR is unit tests, mostly for verify_nsec and verify_nsec3. I think testing those directly makes sense given the security impact of these functions, and the fact that conformance level tests directed at these functions could pass or fail for a lot of reasons not directly related to the correctness of the NSEC/NSEC3 implementations...
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.