yip_utls: hello::craft GREASE bookends collide ~6% (RFC8446 §4.2 violation + fingerprint tell) #78
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/yip#78
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
yip_utls::hello::craft(REALITY.2,crates/yip-utls/src/hello.rs) draws the leading and trailing GREASE extension codepoints independently (two separatewrite_grease_extension/grease(rng)calls, ~lines 127 and 132). Since GREASE has only 16 valid values, the two bookends collide ~1/16 (~6%) of the time — producing two extensions with the same extension type.This was discovered while wiring the REALITY client into yipd's relay-dial (REALITY.4a); the netns/in-process tests there had to add retry-accept loops to tolerate the ~6% reject rate, which is a symptom, not a fix.
Why it matters (two real consequences)
DECODE_ERROR. So ~6% of REALITY handshakes fail outright. In production this self-heals via reconnect-with-backoff, but it's a reliability tax (~6% of connections need a retry) — bad for a latency-sensitive tunnel.For an anti-censorship transport whose entire premise is byte-faithful Chrome mimicry, emitting a malformed, non-Chrome hello 6% of the time is a genuine liability.
Note
The same file already coordinates a single drawn GREASE value across the
supported_groups/key_sharepair — so the authors clearly know GREASE codepoints must be coordinated; the extension bookends were simply missed.Fix
hello::craft, draw the trailing GREASE codepoint distinct from the leading one (mirror BoringSSL's index-based distinctness — e.g. pick two distinct indices into the 16 GREASE values).leading_grease != trailing_greaseacross many seeds.References
crates/yip-utls/src/hello.rs(craft, the two extension-GREASE bookend calls)