Skip to content

fix(dns): resolve names under a numeric ending - #100

Merged
ralyodio merged 1 commit into
masterfrom
fix/numeric-ending
Aug 3, 2026
Merged

fix(dns): resolve names under a numeric ending#100
ralyodio merged 1 commit into
masterfrom
fix/numeric-ending

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

The registry sells .2600. The resolver refused to resolve anything under it.

alt.2600  28  forwarded           -> NXDOMAIN from upstream
seo.rank  28  moshpit(backfill)   -> answered

moshpitCandidate rejected every all-numeric ending outright (policy.ts:65), so a registered name was never looked up. alt.2600 is registered, points at 2604:a880:400:d1:0:4:c3fe:1, and does not resolve — the registry takes the money and the name is dead, with nothing in any log saying why.

Why the rule existed

Address literals. 1.2.3.4 must never be read as 3.4 in this namespace, or whoever registered .4 could intercept traffic meant for a machine. That is a real attack and the guard has to stay.

But the dotted-quad check on the line above already covers it, and the blanket numeric-ending rule caught a far larger class than it needed to.

The narrower rule

A name whose every label is numeric is address-shaped. A numeric ending under a real label can only ever be a name.

input before after
10.0.0.1, 1.2.3.4 rejected rejected
192.168, 12.34 rejected rejected
alt.2600 rejected resolves

The registry still decides whether the name exists. This is only the shape filter, and it should exclude what can never be a name rather than what merely looks unusual.

Tests

Two new, plus one updated: scrambled.123 was asserted non-candidate, which is exactly the behaviour being changed, so it is rewritten rather than worked around. The address cases are asserted explicitly so the protection cannot be lost silently.

144 pass, 0 fail.

The registry sells `.2600`. The resolver refused to resolve anything
under it:

    alt.2600  28  forwarded            -> NXDOMAIN from upstream
    seo.rank  28  moshpit(backfill)    -> answered

`moshpitCandidate` rejected every all-numeric ending outright, so a
registered name was never even looked up. Buying an ending that cannot
resolve is the worst possible failure: the registry takes the money and
the name is dead, with nothing in any log to say why.

The rule was protecting against address literals — `1.2.3.4` must never
be read as `3.4` in this namespace, or whoever registered `.4` could
intercept traffic meant for a machine. But the dotted-quad guard above it
already covers that, and the blanket version caught a much larger class
than it needed to.

Narrowed to what is actually address-shaped: a name whose *every* label is
numeric. `10.0.0.1` and `192.168` stay rejected; `alt.2600` resolves. The
registry still decides whether a name exists — this is only the shape
filter, and it should exclude what can never be a name rather than what
merely looks unusual.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 5f77ab8 into master Aug 3, 2026
2 checks passed
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.

1 participant