PixieFail: predictable TCP sequence seeds (CVE-2023-45236)¶
EDK II'nin TCP stack'i Initial Sequence Number'ları sabit bir base artı sabit bir increment'ten türetiyor; dolayısıyla off-path bir attacker ISN'leri tahmin edip network boot sırasında (örn. HTTP boot) kullanılan TCP bağlantılarını hijack veya spoof edebilir.
Mechanism¶
CSPRNG gereken yerde bir counter
TCP'nin Initial Sequence Number'ı (ISN), blind connection spoofing ve session
injection'a (klasik Morris/Mitnick saldırısı) karşı savunmak için
unpredictable olmak zorundadır. EDK II'nin TcpGetIss() fonksiyonu ise sabit
bir constant ile seed'lenip sabit increment'lerle artırılan bir global
counter döndürüyor:
#define TCP_BASE_ISS 0x4d7e980b
#define TCP_ISS_INCREMENT_1 2048
#define TCP_ISS_INCREMENT_2 100
mTcpGlobalIss += TCP_ISS_INCREMENT_1;
Hiçbir cryptographic randomness işin içine karışmıyor. Bir ISN'i gözlemleyen (ya da basitçe bilen) bir attacker gelecekteki ISN'leri hesaplayabilir ve bir TCP peer'ın segment'leri kabul etmek için kullandığı sequence-number kontrolünü geçer. Bozulan invariant: "ISN geniş bir uzaydan unpredictable şekilde çekilir." Bu, RFC 1948'in (1996) / RFC 6528'in tam tersidir.
Vulnerable fonksiyon: NetworkPkg/TcpDxe/TcpMisc.c içindeki TcpGetIss(). Etki:
TCP session hijacking ve spoofing.
Walkthrough¶
Kavramsal reproduction (boot network'ünde off-path bir attacker):
1. Target uses TCP during boot (HTTP(S) boot / image download over TCP).
2. Observe one ISN, or derive it from the known base+increment sequence.
3. Predict the next ISN and inject crafted segments (RST, data) that the EDK II
TCP stack accepts because they fall within the expected sequence window.
Unpatched bir build'de beklenen sonuç: attacker, on-path olmadan boot TCP bağlantısını spoof/hijack edebilir (örn. bir HTTP-boot download'unu redirect edebilir ya da tamper edebilir).
Detection¶
- Bu bir protocol-design zafiyeti; on-wire'da normal bir TCP injection gibi görünür. Boot TCP flow'unda inject edilmiş RST'lere / beklenmedik segment kaynaklarına ve image-download integrity hatalarına dikkat edin.
Mitigation¶
- ISN üretimini güçlü bir entropy kaynağından (EFI_RNG_PROTOCOL) seed'leyen EDK II fix'ini uygulayın.
- Hijack edilmiş bir TCP stream'in tampered içerik teslim edememesi için authenticated/integrity-checked boot transport'ları (HTTPS boot, signed image'lar) kullanın.