Skip to content

feat(dns): resolve third-level names through an owner's wildcard - #301

Merged
ralyodio merged 1 commit into
mainfrom
fix/vendored-dns-subdomains
Aug 5, 2026
Merged

feat(dns): resolve third-level names through an owner's wildcard#301
ralyodio merged 1 commit into
mainfrom
fix/vendored-dns-subdomains

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Syncs the vendored src/dns.mjs with @moshcoder/moshpit-dns 0.5.0 (published from moshcoder/moshpit-dns#18 for this).

  • www.chovy.hacker now resolves — asked of the registry as written, falling back to the owner's published *.chovy.hacker
  • a sub-name missing both is NXDOMAIN, not parked: a name under someone else's name is not for sale, and parking it would advertise their subdomains
  • * is a label only whole and only leftmost
  • devDependency ^0.3.0^0.5.0

Why the drift test never caught this

It was pinned at ^0.3.0 while the package had reached 0.4.1, so the guard was comparing against a version two releases behind — and passing. Bumping it is what made the gap visible.

Two things the port had to get right beyond copying

Per-ask timeout. The wildcard fallback is a second request. The vendored copy used one AbortController for the whole call, which would have handed the retry whatever was left of the first one's budget — sometimes nothing.

dns resolve crashed on the new status. It prints from a map keyed by status and nothing taught it nxdomain, so explain[result.status]() threw a TypeError over the top of the answer. The suite stayed green through it because every other resolve test passes --json, which never touches the human branch. Fixed, plus a test that walks every status the resolver can return.

Forwarding is unaffected

isOurs still gates on the ending, verified directly:

name ours?
www.google.com no
mail.example.co.uk no
www.chovy.hacker yes
a.b.chovy.hacker no (four labels)

Verification

  • full suite: 1083 passed, 0 failed
  • drift test green against published 0.5.0
  • 82-case behavioural parity sweep of parseRegistryName and resolveName against the published package, comparing return values and the registry ask sequences: 0 divergences
  • new test/dns-subdomains.test.mjs (9 tests) covers the wildcard fallback, the no-double-ask rule, parking still working for bare names, and the subdomain × proxy-mode interaction that exists only in moshcode
  • confirmed the new status guard fails without the fix

🤖 Generated with Claude Code

Syncs the vendored bridge with @moshcoder/moshpit-dns 0.5.0. The devDependency
was pinned at ^0.3.0 while the package had reached 0.4.1, so the drift test —
whose whole job is to make divergence loud — had been comparing against a
version two releases behind and passing.

The namespace is no longer one level deep. `www.chovy.hacker` is asked of the
registry as written, and a name it does not hold falls back to the owner's
published `*.chovy.hacker`. A sub-name that misses both is NXDOMAIN rather than
parked: parking says a name is for sale, and a name under someone else's name
is not, so parking it would advertise their subdomains to a stranger.

Two things the port had to get right beyond copying:

The timeout is per ask rather than per call. The wildcard fallback is a second
request, and the vendored copy's single AbortController would have handed it
whatever was left of the first one's budget — sometimes nothing.

`dns resolve` prints from a map keyed by status, and nothing had taught it the
new `nxdomain` one, so `explain[result.status]()` threw a TypeError over the
top of the answer. The full suite stayed green through it because every other
resolve test asks for --json, which never touches the human branch. Fixed, and
covered by a test that walks every status the resolver can return.

Forwarding is unaffected: `isOurs` still gates on the ending, so `www.google.com`
is still someone else's to answer. Four labels remain a shape the registry
cannot hold.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

92 finding(s)

HIGH/CRITICAL: 50 | MEDIUM: 42

Severity Rule Location
HIGH manifest-typosquat apps/pwa/package.json:19
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH secret-generic-credential apps/pwa/test/apikey-bearer-scheme.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/apikey-mask.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/apikey-reveal.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/approvals-context.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-credits.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-notify.test.mjs:26
HIGH secret-generic-credential apps/pwa/test/approvals-resolve-race.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/auth-page-error.test.mjs:36
HIGH secret-generic-credential apps/pwa/test/cli-device-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/cli-pages-balance.test.mjs:32
HIGH secret-generic-credential apps/pwa/test/cli-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/credits-pack.test.mjs:51
HIGH secret-generic-credential apps/pwa/test/credits-webhook-event-match.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/credits-webhook.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:101
HIGH secret-generic-credential apps/pwa/test/logout-csrf.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-api-key.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-bulk-claim.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-claim-full-name.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-crawlable.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-ending-page.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-pins.test.mjs:22
HIGH secret-generic-credential apps/pwa/test/moshpit-pit-page.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/moshpit-records-page.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-records.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-registry.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/moshpit-related-endings.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-sales.test.mjs:16
HIGH secret-generic-credential apps/pwa/test/moshpit-search.test.mjs:74
HIGH secret-generic-credential apps/pwa/test/moshpit-terms.test.mjs:19
HIGH secret-generic-credential apps/pwa/test/moshpit-tlds-pagination.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/passkey-register-duplicate.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/sessions-output-seq.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/sessions-paste.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/sessions-stream-replay.test.mjs:34
HIGH secret-generic-credential apps/pwa/test/sessions.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/signature.test.mjs:6
HIGH secret-generic-credential test/auth.test.mjs:13
HIGH secret-generic-credential test/auth.test.mjs:63
HIGH secret-generic-credential test/console-cookie-malformed.test.mjs:15
HIGH secret-generic-credential test/console.test.mjs:12
HIGH secret-generic-credential test/mirror.test.mjs:37
HIGH secret-generic-credential test/mirror.test.mjs:77

…and 42 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit be5c6c2 into main Aug 5, 2026
4 checks passed
@ralyodio
ralyodio deleted the fix/vendored-dns-subdomains branch August 5, 2026 04:36
@ralyodio ralyodio mentioned this pull request Aug 5, 2026
ralyodio added a commit that referenced this pull request Aug 5, 2026
Bump moshcode to v0.24.0, releasing third-level Moshpit names (#301), JSON agent status (#300), and the --proxy host refusal fix (#298).
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