Skip to content

Refuse no-default-alpn without alpn in zone files and JSON - #195

Merged
NelsonVides merged 1 commit into
mainfrom
svcb-no-default-alpn-needs-alpn
Nov 16, 2026
Merged

NelsonVides merged 1 commit into
mainfrom
svcb-no-default-alpn-needs-alpn

Conversation

@NelsonVides

Copy link
Copy Markdown
Contributor

RFC 9460 §7.1.1: "When "no-default-alpn" is specified in an RR, "alpn" must also be specified in order for the RR to be "self-consistent"", and §2.4.3 has zone-file implementations enforce self-consistency (SHOULD) and clients reject an RR that is not (MUST). BIND 9.20.30's named-checkzone refuses one, spelled no-default-alpn or key2; dns_erlang loaded it.

main now
Zone file, no-default-alpn or key2 without alpn loads refused, {no_default_alpn_without_alpn, [1]}
JSON, "no-default-alpn": null without "alpn" loads raises {svcb_mandatory_validation_error, {no_default_alpn_without_alpn, [1]}}
Wire, the same decodes decodes
Any of them with alpn loads loads

The check sits with the one for mandatory's keys, under its error for JSON, but only for zone files and JSON. The wire decoder still takes such an RR: the RFC has a client reject the RR rather than the message, and refusing it would fail every message that carries one, from a server that serves one. PowerDNS loads one: its example.com test zone, which test/dns_zone_SUITE_data/example.com.zone comes from, has bar.svcb IN SVCB 5 . port="8004" no-default-alpn .... That line has alpn=h3 in it now, with a comment saying so.

Tests: parse_svcb_with_no_default_alpn reads it with alpn, refuses it without by name, by number, in HTTPS and when mandatory names it, has JSON refuse it, and the wire decoder take it. Taking out the refusal, or refusing on the wire too, makes it fail. The zone writer property's parameters had no-default-alpn without alpn at times, and get an alpn with it now.

RFC 9460 section 7.1.1 has an RR with no-default-alpn carry alpn too, or
it is not self-consistent, and section 2.4.3 has zone-file
implementations enforce that. BIND refuses such an RR, by name or as
key2; dns_erlang loaded it.

Zone files and JSON now refuse it, with the check for mandatory's keys.
The wire decoder still takes it: a client is to reject the RR rather
than the message, and PowerDNS loads one, in the test zone
example.com.zone comes from, whose line has alpn=h3 added now.

The zone writer property's parameters get an alpn with no-default-alpn.
@NelsonVides NelsonVides added the bug Code defect or incorrect behavior label Nov 16, 2026
@NelsonVides NelsonVides self-assigned this Nov 16, 2026
@NelsonVides
NelsonVides merged commit 1ea4f28 into main Nov 16, 2026
6 checks passed
@NelsonVides
NelsonVides deleted the svcb-no-default-alpn-needs-alpn branch November 16, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Code defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant