Repository navigation
QUIC sniffer: Handle zero-filled datagram tails - #6882
Merged
Merged
Conversation
patterniha
pushed a commit
to patterniha/Xray-core
that referenced
this pull request
Oct 3, 2026
Early merge of XTLS#6882 (PR head 1c00a9c), squashed, ahead of it landing upstream: XTLS#6882 Co-authored-by: 风扇滑翔翼 <[email protected]>
olivezane
added a commit
to olivezane/Xray-core-ai
that referenced
this pull request
Oct 6, 2026
7 upstream commits: WireGuard kernelTun IPv6 table index fix (XTLS#6881), WireGuard idle-flow memory and ICMP pong (XTLS#6856, XTLS#6855), QUIC sniffer zero-filled tails (XTLS#6882), XDNS resolver deadlock (XTLS#7089), gRPC redial context (XTLS#6877), scenario test process leaks (XTLS#6863). Conflict in proxy/wireguard/tun_linux.go: took upstream's loop guard while keeping the local errors.New lint fix.
TaiLerV
pushed a commit
to TaiLerV/Xray-core-up
that referenced
this pull request
Oct 7, 2026
The dispatcher caches the datagrams of a UDP flow without their boundaries. SniffQUIC derived keys from the Destination Connection ID of every Initial packet it met and merged their CRYPTO frames into one stream, so Initial packets of another connection in the same flow corrupted the ClientHello. Bytes after the last packet of a datagram, which receivers ignore, ended sniffing unless they were zeros. Sniff the connection of the first Initial packet that decrypts and skip Initial packets of other connections, as Hysteria 2.13.0 does. When the bytes after a packet do not parse, resume at the next Initial packet of that connection, found by its version and Destination Connection ID; this covers Firefox's zero padding, which the zero skipping from XTLS#6882 handled, and any other tail. Tests interleave datagrams of three captured connections and append a non-zero tail; both failed before this change. FuzzSniffQUIC checks that no input panics the sniffer or is written to; 90s and 60s local runs found nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
fanymagnet
pushed a commit
to fanymagnet/Xray-core
that referenced
this pull request
Oct 8, 2026
XTLS#6882 (review) --------- Co-authored-by: 风扇滑翔翼 <[email protected]>
|
thanks a lot, saved our prod, waiting for this PR to be in next release |
This specific edge case appearing in Gemini in Firefox |
BobJustFry
added a commit
to BobJustFry/xray-core
that referenced
this pull request
Oct 18, 2026
- quic sniff: zero-padded datagram tails skipped (upstream XTLS#6882); a complete CRYPTO ClientHello without SNI returns ErrQUICNoSNI and a flow that does not start with an Initial returns ErrQUICNotFirstInitial at once, so the dispatcher stops waiting (no-SNI decision 1 ms instead of the 200 ms budget). QUIC wait budget unchanged. - dispatcher: per-flow QUIC outcome counters in VupenSniffStats (quic[ok nosni notfirst notquic more other]); arrival gaps (dt=...) in the sniff timeout line; direct-miss banner only when the hinted domain would route to a direct outbound, otherwise an Info no-domain line; route memory for repeated UDP flows (src -> IP dst, 60 s from last use, LRU 512) reuses the outbound without sniffing, invalidated by a route generation bumped on network epoch, AUTO node change, spill/unspill and Apple setting change; empty-TCP extra wait off (VupenSniffEmptyTCPWait = 0). - tun: gVisor connection-refused handshakes counted (hsRefused=) and logged at Debug; websocket: dial errors within 15 s of a network change logged with a [netchange] hint. - router: VupenSetAppleViaVpnMode(mode): 0 off, 1 skip the vupen-apple-direct rule while AUTO is on the LTE tier, 2 always skip it (whitelist node picked manually); VupenSetAppleViaVpnOnLte(bool) kept as alias 1/0; invalid mode ignored with a warning; atomic, no restart, log line on change, per-router decision log (CR-103) kept. VupenAutoState: appleViaVpnMode, appleViaVpnOnLte (mode != 0), appleViaVpnActive (mode 2, or mode 1 and on LTE). - tests: encrypted QUIC v1 fixtures (SNI, no SNI incl. halves/gaps/out of order, 0-RTT first, zero tails), route memory recall/generation/TTL/cap/concurrency, QUIC counters, timing, Apple matrix mode x tier x network x marker, mode API, manual node in mode 2. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
When cached UDP datagrams are concatenated, zero bytes after a packet's declared length are treated as another QUIC header.
SniffQUICthen returnsnot initial packetbefore a later Initial can complete the fragmented ClientHello. This can leave IP-addressed UDP traffic without an SNI for domain routing.Skip zero-filled tails after the checked packet boundary. The regression fixture contains two encrypted Initial datagrams: the first needs more data, and their concatenation recovers the expected SNI. The first 1252-byte datagram contains a 996-byte packet followed by 256 zero bytes.
Observed with Firefox 157 HTTP/3 over Hysteria2. A patched build also passes the same browser routing check. This is a follow-up to #4642.
Validation on current
main:go test ./common/protocol/quic -count=1go run ./infra/vformat/main.go -mode check -pwd ./The fixture contains UDP payloads only, with no IP headers or tunnel credentials.