Repository navigation
harden(l1): echo the borrowed site's cipher suite, correct the SNI claim - #2
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes two L1 distinguishers found while reading the code during the 2026-10-01 hardening pass (
docs/ROADMAP.mdH4 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
buildServerHellopinned the suite toTLS_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 got0x1301out 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.ProfileSitereads the negotiated suite off the wire intoFlightProfile.CipherSuite; the relay echoes it (unmeasured falls back to the pinned suite every parroted Chrome hello offers).Compareparses both ServerHellos' suites and reports a mismatch, guarded byTestCanary_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.unexpected-sniprobe 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 ./..., andgofmtall pass. Not verified locally:-race(needs cgo/a C toolchain this machine lacks); CI covers it.🤖 Generated with Claude Code