Closed nametoolong closed 1 year ago
感谢提供一个新颖的思路:某些情况下 TLS 会发送 Alert 但不关闭 TCP 连接。不过这种方式受到的限制也比较明显:
这里顺便说一下,计划中 Origin 会被废弃(也几乎没人在用了),主要是因为:
关于 issue 中的最后一句话,麻烦展开叙述一下。另外,XTLS 正在研究引入 uTLS,即客户端指纹伪造功能。
补充:Origin 严格的写过滤预计会被应用到 Direct 对 TLSv1.2 的传输中。
即使不考虑破坏性,仍存在一个误报率的问题:由于 TLS 的应用广泛且复杂,是否某些 TLS 实现/网络因素会被误报?
TLS 1.3 mandates connection closure upon error. So an RFC-conforming implementation will never trigger a false positive. False negatives are unavoidable.
关于 issue 中的最后一句话,麻烦展开叙述一下。
For example, the attacker can initiate a renegotiation when the upper-layer protocol is TLS 1.2 and XTLS is running in Direct mode (no read filtering). The renegotiation will eventually fail but is enough to leak a huge amount of information. The current implementation of write filtering does not prevent this because close_notify
is non-fatal. TLS 1.2 has so many obscure extensions that the behavioral difference is difficult to eliminate.
Even under TLS 1.3, a corner case exists: when the upper-layer negotiates TLS_AES_128_CCM_8_SHA256
, protected alert records will be 11 bytes long instead of 19 bytes. This is impossible for other ciphersuites. Few applications (mostly IoT devices) use that ciphersuite though. IMHO the list of possible behavior mismatches will only be longer as people try hard to add esoteric new features into TLS 1.3.
I don't think the attacks I've described are practical though. Exploiting the difference between fatal and non-fatal alerts needs precise timing (leveraging the delay between close_notify
and TCP reset) which contradicts the threat model. Also, Xray's prominent use cases rarely cover IoT devices.
Thanks for your post. Should be fixed in https://github.com/XTLS/Xray-core/pull/1235
旧版 XTLS 早已被弃用,新版 XTLS,即 XTLS Vision 仅支持内层 TLSv1.3 非 TLS_AES_128_CCM_8_SHA256
裸奔,谢谢你提到它
This attack is beyond the original threat model of XTLS. This issue is to discuss XTLS usage against more aggressive local adversaries like corporate firewalls.
There is an intrusive way to detect whether an encrypted TLS alert is
close_notify
: injecting binary garbage into the TCP connection. If an endpoint ignores the binary garbage, then it must have received aclose_notify
alert. XTLS parses the record but is not aware of the encryptedclose_notify
, so an active attacker can tell apart XTLS from other TLS stacks.The user starts a huge download over HTTPS. Both Firefox and curl sends
close_notify
early during a download, so the attacker can begin after seeing the first 19-byte encrypted data.The attacker forges TLS records and sends them to the XTLS server. XTLS forwards them to the actual server, who ignores them silently.
The attacker forges malformed TLS records. XTLS closes the connection immediately.
The attacker can now be sure of the existence of XTLS.
This attack is unlikely to be adopted by the GFW due to its potentially destructive effects. However, corporate networks might occasionally be aggressive enough to disrupt all TLS traffic. Direct mode is not a permanent solution: the mismatch between Client Hello extensions and the actual behavior easily spots a XTLS user.