Skip to content

fix(dns): detect the proxy with a real name, not a synthesised one - #468

Merged
ralyodio merged 1 commit into
mainfrom
fix/proxy-probe-name
Aug 30, 2026
Merged

fix(dns): detect the proxy with a real name, not a synthesised one#468
ralyodio merged 1 commit into
mainfrom
fix/proxy-probe-name

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The proxy probe is a TLS handshake with the name in SNI, and the pinned-TLS proxy can only present a certificate for a name that exists — it fetches the registry pin to mint one. Both dns enable and dns service probed with a.<first-ending>, which is never a real name.

Measured against a proxy installed, trusted and listening on 127.0.0.1:443:

SNI result
a.moshpit no certificate
a.2600 no certificate
alt.2600 issuer=CN=Moshpit Local CA

So a working proxy reported as absent, the unit was written without --proxy, names answered their origin, and every https:// URL failed with a self-signed certificate that nothing in any output explained. Bridge healthy, routing correct, proxy running, root trusted — the only wrong thing was the name used to ask.

The fix

No registry endpoint lists names, so a real one can't be discovered here. --proxy-probe <name> supplies it, and the issuer check still runs against it: naming a probe says which name to ask about, never that a proxy is there. A bare flag is reported as the typo it is, rather than falling back to the synthetic name that cannot work.

The synthetic default stays for the no-flag case — it's right on a machine whose proxy serves every ending, and removing it would turn "detected nothing" into "refused to look".

The not-found message now separates the two causes it was conflating (not installed, versus installed and probed with a name it can't serve) because the remedy is completely different.

Tests

Four on proxyProbeFromArgs, extracted so the choice is testable rather than buried in the handler: named probe used verbatim, registry skipped when a name is given, bare flag rejected, synthetic fallback preserved.

Suite: 2734 tests, 0 failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ThnQwoieWt8VR6N7gtgnhp

The proxy probe is a TLS handshake with the name in SNI, and the pinned-TLS
proxy can only present a certificate for a name that exists — it fetches the
registry pin to mint one. Both `dns enable` and `dns service` probed with
`a.<first-ending>`, which is never a real name.

Measured against a proxy installed, trusted and listening on 127.0.0.1:443:

    a.moshpit  -> no certificate
    a.2600     -> no certificate
    alt.2600   -> issuer=CN=Moshpit Local CA

So a working proxy reported as absent, the unit was written without --proxy,
names answered their origin, and every https:// URL failed with a self-signed
certificate that nothing in any output explained. The bridge was healthy, the
routing correct, the proxy running, the root trusted — and the only wrong thing
was the name used to ask.

No registry endpoint lists names, so a real one cannot be discovered here.
`--proxy-probe <name>` supplies one, and the issuer check still runs against it:
naming a probe says which name to ask about, never that a proxy is there. A bare
flag is reported as the typo it is rather than falling back to the synthetic
name that cannot work.

The synthetic default is kept for the no-flag case: it is right on a machine
whose proxy serves every ending, and removing it would turn "detected nothing"
into "refused to look".

The not-found message now separates the two causes it was conflating — not
installed, versus installed and probed with a name it cannot serve — because
the remedy is completely different.

Suite: 2734 tests, 0 failures.

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

Claude-Session: https://claude.ai/code/session_01ThnQwoieWt8VR6N7gtgnhp
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

1 finding(s) in the 2 file(s) this pull request changes.

HIGH/CRITICAL: 1

Severity Rule Location
HIGH tls-verification-disabled src/dns.mjs:766
90 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 7 | **MEDIUM**: 73 | **LOW**: 10

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:86
HIGH sh-remote-script-execution install.sh:90
HIGH sh-remote-script-execution install.sh:202
HIGH sh-remote-script-execution install.sh:213
HIGH sh-remote-script-execution install.sh:219
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:139
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:153
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:179
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:373
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:377
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:422
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:671
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:867
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:869
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:928
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:974
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1044
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1147

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

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 0d2f903 into main Aug 30, 2026
6 checks passed
@ralyodio ralyodio mentioned this pull request Aug 30, 2026
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