Repository navigation
Conversation
BoringSSL draws the payload length of its GREASE ECH extension on every connection, 32 bytes times a random integer in [4, 7] plus the AEAD tag, so Chrome sends 144, 176, 208 or 240 bytes. NSS pads a fake inner hello once from the SNI and sends that length every time: Firefox 157 sends 240 bytes on every connection. uTLS sent one fixed length where BoringSSL varies: an extension with no CandidatePayloadLens picked 128 and so sent 144 bytes every time, and a spec fingerprinted from a Chrome capture replayed the capture's one length on every connection. The suite half of this mismatch was CVE-2026-27017. Share BoringSSL's four lengths between BoringGREASEECH() and the default for an empty CandidatePayloadLens, and make FromRaw replay a captured GREASE ECH with BoringSSL's draw when the capture carries RFC 8701 GREASE values, which BoringSSL sends and NSS does not. A capture without them keeps its one length, as Firefox does; the length alone cannot tell the stacks apart, since Firefox's 240 is one of BoringSSL's four. The Firefox parrots are unchanged. Refs: refraction-networking#375
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.
BoringSSL draws the payload length of its GREASE ECH extension on every connection: 32 bytes times a random integer in [4, 7], plus the AEAD tag, so Chrome sends 144, 176, 208 or 240 bytes (
ssl/encrypted_client_hello.cc,setup_ech_grease). NSS instead pads a fake inner hello from the SNI once and sends that length every time (tls13_MaybeGreaseEch,tls13_PadChInner). Captured locally: Chromium 153 sends all four lengths across 18 hellos; Firefox 157 sends 240 bytes on every one of 40 hellos with hostnames up to 100 characters, and 272 beyond that, with the AEAD alternating between AES-128-GCM and ChaCha20.uTLS sends one fixed length in two cases where BoringSSL varies:
GREASEEncryptedClientHelloExtensionwith noCandidatePayloadLens, which is what a JSON spec or a hand-written spec gets unless it callsBoringGREASEECH(), picks 128 and so sends 144 bytes every time.The HPKE suite half of this mismatch was CVE-2026-27017 (#375): the Chrome parrots now keep AES, as BoringSSL keeps its hardware choice. The length half was not reported.
This change shares BoringSSL's four lengths between
BoringGREASEECH()and the default for an emptyCandidatePayloadLens, and makesFromRawreplay a captured GREASE ECH with BoringSSL's draw when the capture carries RFC 8701 GREASE values, which BoringSSL sends and NSS does not. A capture without them keeps its one length, as Firefox does. The length alone cannot tell the stacks apart, since Firefox's 240 is one of BoringSSL's four. The extension's ownWritestill records the captured length faithfully, and the Firefox parrots are unchanged.Tests cover the zero-value default,
Write()on an AES and a ChaCha20 capture, and a fingerprint-and-replay round trip throughApplyPreset: a GREASE-bearing hello with a 208-byte payload must vary over the four lengths, and a GREASE-free hello with a 240-byte payload must send 240 every time.Verified with Go 1.27.3:
go test ./...,go test -raceon the ECH tests,go vet,gofmt -s,go fix -diff, staticcheck and golangci-lint report nothing.Refs #375