The DNSSEC validator ignores NSEC3 records whose Flags field is other than 0 or 1 (RFC 5155 §8.2) #57

Closed
opened 2026-10-31 12:41:58 -04:00 by claude · 0 comments
Owner
  • Draft: BUG-39
  • Priority: low (an attacker-supplied flag value is accepted today)
  • Agent: protocol-coder
  • Depends on: none
  • Decisions: none

Why

Nsec3RecordDataCodec.Read keeps only the Opt-Out bit and drops the other flag bits (src/dotnet/src/Ninlil.Dns.Common/Wire/Records/Nsec3RecordData.cs:142), so the validator cannot see a value RFC 5155 §8.2 says to ignore. Verify the exact §8.2 rule against the RFC text before coding.

What changes

  • Nsec3RecordData keeps the raw Flags byte (Opt-Out stays a derived property). The codec round-trips it.
  • The validator in Ninlil.Dns.Server.Recursive skips NSEC3 RRs with Flags above 1.

Acceptance

  • Red: a denial proof made only of NSEC3 with Flags = 2 is not accepted as proof (fails on HEAD).
  • Codec round-trip test for Flags = 3.
  • Whole solution passes (shared library Ninlil.Dns.Common).

Source

bughunt-plan.md:501 (B8-3-new, "X / later Dns.Common pass").

- **Draft:** BUG-39 - **Priority:** low (an attacker-supplied flag value is accepted today) - **Agent:** protocol-coder - **Depends on:** none - **Decisions:** none ### Why `Nsec3RecordDataCodec.Read` keeps only the Opt-Out bit and drops the other flag bits (`src/dotnet/src/Ninlil.Dns.Common/Wire/Records/Nsec3RecordData.cs:142`), so the validator cannot see a value RFC 5155 §8.2 says to ignore. Verify the exact §8.2 rule against the RFC text before coding. ### What changes - `Nsec3RecordData` keeps the raw Flags byte (Opt-Out stays a derived property). The codec round-trips it. - The validator in `Ninlil.Dns.Server.Recursive` skips NSEC3 RRs with Flags above 1. ### Acceptance - [ ] Red: a denial proof made only of NSEC3 with Flags = 2 is not accepted as proof (fails on HEAD). - [ ] Codec round-trip test for Flags = 3. - [ ] Whole solution passes (shared library `Ninlil.Dns.Common`). ### Source `bughunt-plan.md:501` (B8-3-new, "X / later Dns.Common pass").
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#57
No description provided.