QUIC sniffer: Don't accept ClientHello with gaps in CRYPTO data (#7292)

https://github.com/XTLS/Xray-core/pull/7292#pullrequestreview-5712194488

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
This commit is contained in:
AL
2026-10-31 08:31:30 +00:00
committed by GitHub
co-authored by 风扇滑翔翼
parent 6ca6d8a693
commit 9b8190f52c
+4
View File
@@ -101,6 +101,10 @@ func ReadClientHello(data []byte, h *SniffHeader) error {
return errNotClientHello
}
if nameType == 0 {
// RFC 6066 requires a non-empty HostName.
if nameLen == 0 {
return errNotClientHello
}
// QUIC separated across packets
// May cause the serverName to be incomplete
b := byte(0)