Skip to content

harden(l1): echo the borrowed site's cipher suite, correct the SNI claim - #2

Merged
croc100 merged 1 commit into
mainfrom
harden/echo-cipher-suite-correct-sni-claim
Oct 3, 2026
Merged

croc100 merged 1 commit into
mainfrom
harden/echo-cipher-suite-correct-sni-claim

Conversation

@croc100

@croc100 croc100 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Closes two L1 distinguishers found while reading the code during the 2026-10-01 hardening pass (docs/ROADMAP.md H4 and H5). Both are about the relay's two answer paths — local for a tagged client, spliced for everyone else — agreeing on what they put in cleartext.

H4 — echo the borrowed site's cipher suite

buildServerHello pinned the suite to TLS_AES_128_GCM_SHA256, and the profile never recorded what the borrowed site actually negotiated. The cipher suite is cleartext in the ServerHello, so against a site preferring AES-256 or ChaCha20 a tagged client got 0x1301 out of local state while a spliced probe got the site's real choice — two suites from one address, separable with no decryption and no key, the same shape of split the last pass closed on the time axis.

  • ProfileSite reads the negotiated suite off the wire into FlightProfile.CipherSuite; the relay echoes it (unmeasured falls back to the pinned suite every parroted Chrome hello offers).
  • It names nothing about how Warren encrypts — still ChaCha20-Poly1305 under the derived key — so echoing the measured value is free.
  • The gate measures it: Compare parses both ServerHellos' suites and reports a mismatch, guarded by TestCanary_CipherSuiteMismatchIsDetected, which forces the relay onto a suite the site does not negotiate and requires the finding to fire.

H5 — correct the SNI claim

The transport package comment claimed an unauthenticated connection is spliced "to the real site the ClientHello's SNI names." It is not: a relay fronts one site and splices everything unauthenticated to FallbackAddr, whatever SNI the hello carried.

  • For real traffic the two coincide — a genuine Warren client always presents the borrowed site's SNI — and a probe presenting another name is handed the borrowed site anyway, exactly as a real single-site server answers an unexpected SNI with its own default certificate.
  • Routing by SNI was rejected on purpose: it would make the relay an open proxy to arbitrary hosts (the amplification problem tracked as H7), a regression rather than a fix. So the behaviour is correct and the claim was wrong.
  • The comment is fixed and an unexpected-sni probe asserts the relay still matches the borrowed site under a name neither endpoint fronts — a relay that routed by SNI would return a certificate for a different name and separate itself on the leaf digest alone.

Verification

go build, go vet, go test ./..., and gofmt all pass. Not verified locally: -race (needs cgo/a C toolchain this machine lacks); CI covers it.

🤖 Generated with Claude Code

Two distinguishers found while reading this code during the 2026-10-01 pass
(ROADMAP H4, H5), closed together because both are the relay's two answer paths
— local for a tagged client, spliced for everyone else — disagreeing on what
they put in cleartext.

Cipher suite (H4). buildServerHello pinned the suite to TLS_AES_128_GCM_SHA256
and the profile never recorded what the borrowed site actually chose. The suite
is cleartext in the ServerHello, so against a site preferring AES-256 or
ChaCha20 a tagged client got 0x1301 out of local state while a spliced probe got
the site's real choice — two suites from one address, no decryption and no key
required, the same split the last pass closed on the time axis. ProfileSite now
reads the negotiated suite off the wire (FlightProfile.CipherSuite) and the
relay echoes it. The value names nothing about how Warren encrypts the session
(still ChaCha20-Poly1305 under the derived key); it only has to agree with what
the site answers, so echoing the measured value is free. Unmeasured falls back
to the pinned suite, which every parroted Chrome hello offers.

The gate measures it. Compare parses both ServerHellos' suites and reports a
mismatch, and a canary forces the relay onto a suite the site does not negotiate
and requires the finding to fire — a measurement with no canary is one that can
quietly stop measuring, which is the rule the last pass established.

SNI (H5). The transport package comment said an unauthenticated connection is
spliced "to the real site the ClientHello's SNI names". It is not: a relay
fronts one site and splices everything unauthenticated to FallbackAddr, whatever
SNI the hello carried. For real traffic the two coincide — a genuine client
always presents the borrowed site's SNI — and a probe presenting another name is
handed the borrowed site anyway, which is what a real single-site server does
with an unexpected SNI: its default certificate. Routing by SNI was rejected on
purpose, because it would make the relay an open proxy to arbitrary hosts (H7)
and a regression rather than a fix. So the behaviour is correct and the claim
was wrong: the comment is fixed, and an unexpected-sni probe asserts the relay
still matches the borrowed site under a name neither endpoint fronts — a relay
that routed by SNI would return a certificate for a different name and separate
itself on the leaf digest alone.

Verified: go build, go vet, go test ./..., gofmt. Not verified locally: -race,
which needs cgo and a C toolchain this machine lacks; CI covers it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@croc100
croc100 merged commit 80ca159 into main Oct 3, 2026
2 checks passed
@croc100
croc100 deleted the harden/echo-cipher-suite-correct-sni-claim branch October 3, 2026 02:35
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