Skip to content

[core] Preserve unknown types in NSEC(3) type bitmaps - #154

Merged
Flowdalic merged 1 commit into
MiniDNS:masterfrom
Flowdalic:dnssec-validation-partly-invalid-signatures
Oct 18, 2026
Merged

Flowdalic merged 1 commit into
MiniDNS:masterfrom
Flowdalic:dnssec-validation-partly-invalid-signatures

Conversation

@Flowdalic

Copy link
Copy Markdown
Collaborator

When parsing NSEC and NSEC3 RRs, types unknown to MiniDNS, for example the private use type 65534 that BIND places at many zone apexes, were dropped from the type list. The type bitmap was then re-created from the remaining known types, so the serialized RDATA used for signature verification no longer matched the signed data. As a result, DNSSEC validation of affected responses, like the NXDOMAIN for github.xxx, failed with "Signature is invalid".

Parsed NSEC(3) RRs now keep the type bitmap as received. The new typeValues field exposes all types, including unknown ones, which toString() renders as "TYPE" as per RFC 3597.

Note that the cause presumed in #121, a zone with partly invalid signatures, was not the actual cause: all signatures of the .xxx zone are valid, MiniDNS altered the signed data while parsing it.

Thanks to René Kilczan for reporting this.

Fixes #121.

@Flowdalic
Flowdalic force-pushed the dnssec-validation-partly-invalid-signatures branch from 525eccb to aa2402c Compare October 18, 2026 10:38
@coveralls

coveralls commented Oct 18, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39121651542

Coverage increased (+0.2%) to 60.175%

Details

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

Uncovered Changes

No uncovered changes found.

Coverage Regressions

13 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
org/minidns/record/NSEC3.java 9 76.84%
org/minidns/record/NSEC.java 4 96.0%

Coverage Stats

Coverage Status
Relevant Lines: 4740
Covered Lines: 3019
Line Coverage: 63.69%
Relevant Branches: 1786
Covered Branches: 908
Branch Coverage: 50.84%
Branches in Coverage %: Yes
Coverage Strength: 2.85 hits per line

💛 - Coveralls

When parsing NSEC and NSEC3 RRs, types unknown to MiniDNS, for example
the private use type 65534 that BIND places at many zone apexes, were
dropped from the type list. The type bitmap was then re-created from
the remaining known types, so the serialized RDATA used for signature
verification no longer matched the signed data. As a result, DNSSEC
validation of affected responses, like the NXDOMAIN for github.xxx,
failed with "Signature is invalid".

Parsed NSEC(3) RRs now keep the type bitmap as received. The new
typeValues field exposes all types, including unknown ones, which
toString() renders as "TYPE<value>" as per RFC 3597.

Note that the cause presumed in MiniDNS#121, a zone with partly invalid
signatures, was not the actual cause: all signatures of the .xxx zone
are valid, MiniDNS altered the signed data while parsing it.

Thanks to René Kilczan for reporting this.

Fixes MiniDNS#121.
@Flowdalic
Flowdalic force-pushed the dnssec-validation-partly-invalid-signatures branch from aa2402c to 5f2d899 Compare October 18, 2026 11:02
@Flowdalic
Flowdalic merged commit 504fffe into MiniDNS:master Oct 18, 2026
2 checks passed
@Flowdalic
Flowdalic deleted the dnssec-validation-partly-invalid-signatures branch October 18, 2026 11:05
@rekire

rekire commented Oct 18, 2026

Copy link
Copy Markdown

Finally yeah. Thanks!

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.

Getting DnssecValidationFailedException for non existing domain

3 participants