Skip to content

Dnssec nsec validation - #162

Merged
Flowdalic merged 2 commits into
MiniDNS:masterfrom
Flowdalic:dnssec-nsec-validation
Oct 24, 2026
Merged

Flowdalic merged 2 commits into
MiniDNS:masterfrom
Flowdalic:dnssec-nsec-validation

Conversation

@Flowdalic

Copy link
Copy Markdown
Collaborator

No description provided.

@coveralls

coveralls commented Oct 20, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39406732699

Coverage increased (+0.1%) to 63.986%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 48 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

48 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
org/minidns/dnssec/DnssecClient.java 26 89.34%
org/minidns/dnssec/Verifier.java 12 87.34%
org/minidns/dnssec/DnssecUnverifiedReason.java 10 73.49%

Coverage Stats

Coverage Status
Relevant Lines: 4956
Covered Lines: 3325
Line Coverage: 67.09%
Relevant Branches: 1908
Covered Branches: 1067
Branch Coverage: 55.92%
Branches in Coverage %: Yes
Coverage Strength: 2.98 hits per line

💛 - Coveralls

verifyNsec() only rejected a negative response if it contained an NSEC
or NSEC3 record that did not prove the denial of existence ("Invalid
NSEC!"). If the response contained no NSEC(3) record at all, the
denial was accepted as authentic as long as, e.g., a validly signed
SOA RR was present. An attacker able to inject responses could thus
forge an authentic denial of existence for any name or type in a
signed zone by replaying the zone's signed SOA RR and omitting the
NSEC(3) records.

A negative response is now only authentic if a valid NSEC(3) proof is
present; otherwise the new NoDenialOfExistenceReason is reported. This
resolves the "Shouldn't we also throw if !nsecPresent?" TODO.
Verifier.verifyNsec3() hashed the queried name as many times as the
NSEC3 RR requested, without an upper bound. An attacker-supplied NSEC3
RR with a large iteration count could thus impose expensive hashing.

NSEC3 RRs with more than 100 iterations are now rejected before
hashing, as recommended by RFC 9276 § 3.2, with the new
Nsec3IterationCountExceededReason.
@Flowdalic
Flowdalic force-pushed the dnssec-nsec-validation branch from 7219fbf to ac9aa39 Compare October 20, 2026 10:16
@Flowdalic
Flowdalic merged commit 1d2af05 into MiniDNS:master Oct 24, 2026
3 checks passed
@Flowdalic
Flowdalic deleted the dnssec-nsec-validation branch October 24, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants