Out-of-bounds read in scapy - #VU159473
Published: November 5, 2026
Vulnerability details
The vulnerability allows disclosure of out-of-bounds memory when Scapy receives packets through libpcap. Bytes beyond the captured packet can be returned as packet data, potentially exposing stale contents from a previous packet. When an application constructs a response from that data, the extra bytes can be reflected in its reply.
The vulnerability exists due to Scapy reading according to the reported original packet length rather than limiting the read to the number of bytes actually captured by libpcap. A remote attacker can send a packet whose original length exceeds the captured length to an application receiving packets through Scapy's libpcap backend, causing an out-of-bounds read. Disclosure to the attacker depends on the application returning the extra data, as demonstrated with an ICMP echo response.
The advisory demonstrates the issue using a real libpcap offline handle with conf.use_pcap enabled, without requiring live traffic or capture privileges. A 65,549-byte Ethernet/IP/ICMP frame captured as 65,535 bytes is returned at its original length, incorporating a private tail left by a preceding packet and reflecting it through Scapy's ICMP echo answering functionality. A control frame of 65,535 bytes has no length mismatch and does not expose the preceding packet's tail.