Skip to content

PixieFail: DHCPv6 Server ID buffer overflow (CVE-2023-45230)

EDK II'nin DHCPv6 client'ı, attacker-controlled ve aşırı büyük bir Server ID (DUID) option'ını length'ini sınırlamadan request paketine ekleyerek IPv6 network boot sırasında request buffer'ını overflow ediyor.

Mechanism

Sabit boyutlu request paketine kopyalanan, server-controlled DUID

DHCPv6 client kendi Request mesajını oluştururken, server'ın Advertise'ında aldığı Server ID (DUID)'i geri yansıtmak (echo) zorunda. Request paketi DHCP6_BASE_PACKET_SIZE (1024 byte) artı option length'leri kadar allocate ediliyor; ama Server ID option'ı Length'i üzerinde hiçbir sanity check olmadan, tamamen güvenilerek işleniyor:

Cursor = Dhcp6AppendOption(Cursor, HTONS(Dhcp6OptServerId),
                           ServerId->Length, ServerId->Duid);

Kötü niyetli bir server, buffer'ın tutabileceğinden çok daha büyük bir DUID döndürür; böylece append işlemi Packet->Dhcp6.Option'ın ötesine yazarak pool'u corrupt eder. Bozulan invariant: "echo edilen Server ID, allocate edilmiş request paketine sığar."

Zafiyetli fonksiyon NetworkPkg/Dhcp6Dxe/Dhcp6Io.c içindeki Dhcp6SendRequestMsg(). CVSS 8.3. Bu, çekirdek DHCPv6 client path'i; CVE-2023-45235 ise ilgili PXE proxy Advertise varyantı.

Walkthrough

Kavramsal reproduction (network-boot path, OVMF/QEMU hedefi):

1. Target performs IPv6 DHCPv6 during PXE boot (SOLICIT -> ADVERTISE -> REQUEST).
2. Rogue DHCPv6 server replies to SOLICIT with an Advertise whose Server ID
   (option 2 / DUID) has Length far larger than 1024 bytes.
3. The client must echo that Server ID in its REQUEST. Dhcp6SendRequestMsg()
   appends ServerId->Length bytes into the 1024-byte request packet -> overflow.

Quarkslab'in PoC'u pixiefail-CVE-2023-45230.py aşırı büyük DUID'i forge ediyor. Patch'lenmemiş bir build'de beklenen sonuç: DXE network stack'inde heap/pool corruption, firmware crash ve potansiyel control-flow hijack (pre-OS).

Warning

Secure Boot tamamlanmadan önce firmware (DXE) içinde çalışır; kontrollü bir overflow, tam platform privilege ile execute eder. Yalnızca lab VM'inde.

Detection

  • PXE VLAN'ında rogue bir DHCPv6 responder'ı birincil sinyaldir.
  • Server ID (option 2) length'i normal DUID boyutlarının (< ~130 byte) ötesinde olan DHCPv6 Advertise frame'lerini işaretle.

Mitigation

  • ServerId->Length'i request buffer'a karşı sınırlayan EDK II NetworkPkg patch'ini uygula.
  • Kullanılmadığında PXE/IPv6 boot'u devre dışı bırak; DHCP altyapısını authenticate edip segregate et.

References