Upstream answers that point public names at private addresses lose those records when rebind protection is on (off by default) #139

Open
opened 2026-10-31 12:42:13 -04:00 by claude · 0 comments
Owner
  • Draft: PQ-31
  • Priority: medium
  • Agent: coder
  • Depends on: #136
  • Decisions: Q-PQ-9, Q-PQ-10

Why

A public name that resolves to a LAN address lets a web page reach LAN devices from the browser.

What changes

  • DnsHygieneOptions:
    • RebindProtection (bool, default false: it breaks services that publish private addresses in public DNS, so it is opt-in)
    • RebindProtectionExemptDomains (list, so no environment variable; documented as such)
  • The private ranges come from the IANA IPv4 and IPv6 Special-Purpose Address Registries (RFC 6890): RFC 1918, loopback, link-local, ULA fc00::/7, CGNAT 100.64.0.0/10, 0.0.0.0/8 and IPv4-mapped forms. They are held in one table in Ninlil.Dns.Server.Core/Hygiene/.
  • LocalNetworkGuard checks A and AAAA records in the answer from both upstream resolvers, after the cache. That way a settings change applies at once, and cached entries stay intact.
  • The reply: private A and AAAA records are removed from the answer; other records in it stay. If no answer record is left for the question, the reply is NODATA (NOERROR, empty answer).
  • Names under exempt domains, and names answered by local zones, rewrites, hosts files or the bare-name sources (they never reach this check), are untouched.
  • The #101 outcome, when present, records a Rebind block kind (extend the enum).

Acceptance

  • Test fails first in src/dotnet/tests/Ninlil.Dns.Server.Forwarding.Tests: with the option on, the fake upstream answers evil.example A 192.168.1.10 and A 93.184.215.14; the client gets only the public record. With only the private record, the client gets NODATA.
  • ok.example A 93.184.215.14 passes unchanged; an exempt domain passes; with the option at its default (off) the private record passes.
  • Recursive tests likewise.
  • Pipeline benchmark: no measurable cost when the answer has no private address.
  • Option change; README.

Source

  • RFC 6890; IANA special-purpose address registries; audit-feature-parity.md §2A #9.
  • Owner decision 2026-10-31 (Q-PQ-9): rebind protection off by default.
  • Owner decision 2026-10-31 (Q-PQ-10): "strip private records".
- **Draft:** PQ-31 - **Priority:** medium - **Agent:** coder - **Depends on:** #136 - **Decisions:** Q-PQ-9, Q-PQ-10 ### Why A public name that resolves to a LAN address lets a web page reach LAN devices from the browser. ### What changes - `DnsHygieneOptions`: - `RebindProtection` (bool, default false: it breaks services that publish private addresses in public DNS, so it is opt-in) - `RebindProtectionExemptDomains` (list, so no environment variable; documented as such) - The private ranges come from the IANA IPv4 and IPv6 Special-Purpose Address Registries (RFC 6890): RFC 1918, loopback, link-local, ULA `fc00::/7`, CGNAT `100.64.0.0/10`, `0.0.0.0/8` and IPv4-mapped forms. They are held in one table in `Ninlil.Dns.Server.Core/Hygiene/`. - `LocalNetworkGuard` checks A and AAAA records in the answer from both upstream resolvers, after the cache. That way a settings change applies at once, and cached entries stay intact. - The reply: private A and AAAA records are removed from the answer; other records in it stay. If no answer record is left for the question, the reply is NODATA (NOERROR, empty answer). - Names under exempt domains, and names answered by local zones, rewrites, hosts files or the bare-name sources (they never reach this check), are untouched. - The #101 outcome, when present, records a `Rebind` block kind (extend the enum). ### Acceptance - [ ] Test fails first in `src/dotnet/tests/Ninlil.Dns.Server.Forwarding.Tests`: with the option on, the fake upstream answers `evil.example A 192.168.1.10` and `A 93.184.215.14`; the client gets only the public record. With only the private record, the client gets NODATA. - [ ] `ok.example A 93.184.215.14` passes unchanged; an exempt domain passes; with the option at its default (off) the private record passes. - [ ] Recursive tests likewise. - [ ] Pipeline benchmark: no measurable cost when the answer has no private address. - [ ] Option change; README. ### Source - RFC 6890; IANA special-purpose address registries; `audit-feature-parity.md` §2A #9. - Owner decision 2026-10-31 (Q-PQ-9): rebind protection off by default. - Owner decision 2026-10-31 (Q-PQ-10): "strip private records".
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.

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