Repository navigation
fix(gateway): honour declared lengths when sniffing SNI - #1602
Merged
Merged
Conversation
kvinwang
added a commit
that referenced
this pull request
Nov 18, 2026
CertLock follows #1599-#1601 on wavekv 2.2: the lock value carries a nonce, a lease stamped beyond the drift bound counts as expired, and release and lease-guarded writes are no-ops once the lease expired by the local clock. The force-release, clock-step-back and stale-release counterexamples become positive theorems: ownership on one node under any clock, and a release or guarded commit losing LWW to any successor whose clock is within the drift bound. The replication gap, skew beyond the drift bound, and cross-node force release remain as counterexamples. Sni follows #1602: the returned name lies within every declared block. CertStore follows #1603: no exact-match table, empty first label refused. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
enabled auto-merge
November 18, 2026 08:46
extract_sni read the record, handshake, extensions and ServerNameList lengths but ignored them, scanning on until the buffer ran out. A server_name extension placed after an extensions block declared empty, or after the end of the first record, was still returned. Parse each block only within its declared length, truncated to the bytes received so far so a ClientHello arriving over several reads still parses as before, and reject an extensions or ServerNameList length that does not fill its enclosing block or an extension longer than the space left. Security: low. The sniffed name picks the backend app (and, when terminating, the route) while the TLS stack later parses the same ClientHello and would see a different name or reject it. The client controls both views of its own hello, so this is a parser differential rather than a bypass, but routing should agree with what TLS sees. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
fix/gateway-sni-declared-lengths
branch
from
November 18, 2026 09:36
50f0d34 to
f62e7e2
Compare
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.
extract_sniignored the declared record, handshake, extensions-block and ServerNameList lengths, so a server_name placed outside them (e.g. after an extensions block declared empty) was still returned. The parser now reads each block only within its declared length and rejects inconsistent lengths. Partial buffers still parse as far as they go, so split reads behave as before; a ClientHello fragmented over records is parsed within the first record.Security impact is low: the sniffed name picks the backend while the TLS stack parses the same ClientHello, so this was a mismatch between two parsers of the client's own bytes rather than a bypass. Routing should still agree with what TLS sees.
Found by the Lean model of the parser (#1597,
Sni.lean).