Skip to content

utls: REALITY replay guard on dev-1.9, no server_name ack a dest cannot match - #210

Merged
Miroshka000 merged 2 commits into
devfrom
chore/utls-dev-1.9-reality
Dec 5, 2026
Merged

Miroshka000 merged 2 commits into
devfrom
chore/utls-dev-1.9-reality

Conversation

@Miroshka000

Copy link
Copy Markdown

Raises the utls replace to getmikan/utls v0.0.0-20261205232209-e83190d8a0e5 (dev-1.9, was b60cfbd40b44):

  • reality: carry #7 and the client root re-check onto dev-1.9 utls#8: a REALITY server takes a ClientHello once (a replay goes to dest) and learns dest's records ahead of the first client; a client re-checks a resumed session's chain against the current roots.
  • getmikan/utls@e83190d: REALITY's EncryptedExtensions carry no server_name ack. A dest that negotiates no ALPN and sends no ack has 6 bytes of EncryptedExtensions against the server's 10; REALITY cannot shorten a record, so every handshake with such a dest failed (padding: -4). Covered by TestRealityTargetWithEmptyEncryptedExtensions in the fork.

Checked locally (Go 1.26.11, Windows): go mod tidy, go vet ./..., go build ./..., go test ./listener/... ./component/tls/... ./transport/... ./adapter/outbound/....

…server_name ack

getmikan/utls v0.0.0-20261205232209-e83190d8a0e5, the dev-1.9 line Citrus is
on, now with fork PR 8 (a REALITY server takes a ClientHello once and learns
the target's records ahead of the first client; a client re-checks a resumed
session's chain against the current roots) and e83190d: REALITY's
EncryptedExtensions carry no server_name ack, which a target without ALPN and
without the ack cannot hold, so every handshake with such a target failed on a
negative padding.
@Miroshka000
Miroshka000 merged commit f4e7203 into dev Dec 5, 2026
17 checks passed
@Miroshka000
Miroshka000 deleted the chore/utls-dev-1.9-reality branch December 5, 2026 23:31
Miroshka000 added a commit to Miroshka000/mikan that referenced this pull request Dec 6, 2026
… not have

getmikan/utls e83190d on its dev-1.9 line (v0.0.0-20261205232209-e83190d8a0e5).
A REALITY server pads its records to the target's and cannot shorten one; the
server_name ack Go's crypto/tls has sent since 1.25 made its EncryptedExtensions
4 bytes longer than those of a target without ALPN and without the ack, and
every authenticated handshake with such a target failed. The nodes' REALITY
sends no ack now. Citrus takes the same pin in getmikan/Citrus#210.

Checked: go vet, go build, the tests of internal/node (but the three that fail
on Windows), internal/proto, internal/sub/mihomo and cmd/mikan
(TestDepsLinkNoCore).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant