CVE-2026-0799 in libpcapinfo

Summary

by MITRE • 09/05/2026

In BPF instructions that load/store a value from/to a scratch memory register the register index is an unsigned 32-bit integer and must not exceed 15, but libpcap BPF interpreter does not validate the value. In particular uncommon use cases a crafted filter program can cause the interpreter to try reading and writing the OS process memory in the 16GiB starting at the current stack frame on 64-bit architectures and in the entire address space on 32-bit architectures.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 09/05/2026

The vulnerability described involves a critical input validation failure within the libpcap BPF interpreter, specifically concerning the handling of scratch memory register indices during load and store operations. In the Berkeley Packet Filter architecture, instructions that access scratch memory rely on a register index to determine which slot in the virtual stack is being accessed. According to the specification for these instructions, this index must be an unsigned 32-bit integer but is strictly constrained by implementation details to not exceed fifteen. This limitation exists because most BPF implementations allocate only sixteen slots of scratch space per packet processing context. However, libpcap fails to enforce this upper bound check when parsing or executing filter programs. As a result, if a crafted BPF program provides an index value greater than fifteen but within the valid range for an unsigned 32-bit integer, the interpreter proceeds with the operation without raising an error or rejecting the instruction.

The operational impact of this flaw is severe due to how memory addresses are calculated in the absence of proper bounds checking. On 64-bit architectures, when a register index exceeding fifteen is used, the resulting address calculation can point far beyond the allocated scratch space into the OS process memory starting at an offset corresponding to sixteen times the stack frame size, which amounts to approximately 16 GiB from the current stack location. This means that read operations will retrieve arbitrary data from kernel or user-space memory regions unrelated to the packet filtering task, while write operations can overwrite critical memory structures elsewhere in the process address space. On 32-bit architectures, where the total virtual address space is significantly smaller and more densely packed with system resources, an invalid index can potentially access any location within the entire available address space of the process. This lack of isolation effectively turns a packet filtering utility into a mechanism for arbitrary memory read and write operations.

From a security classification perspective, this vulnerability aligns closely with CWE-125 Out-of-bounds Read and CWE-787 Out-of-bounds Write in the Common Weakness Enumeration framework. The root cause is a classic boundary check omission where the developer assumed or relied on external constraints that were not enforced by the software itself. In terms of attack vectors, this flaw facilitates privilege escalation if libpcap is used within setuid binaries or network monitoring daemons running with elevated privileges. An attacker could craft malicious packet filters to leak sensitive information such as cryptographic keys, session tokens, or other confidential data residing in adjacent memory regions (CWE-200 Information Exposure). Furthermore, the ability to write to arbitrary memory locations allows for code execution attacks by overwriting function pointers or return addresses on the stack, leading to remote code execution capabilities. This behavior is consistent with techniques observed in ATT&CK framework categories related to Memory Manipulation and potentially Command and Control if used exfiltrate data back to an attacker-controlled server.

Mitigation strategies must focus on immediate patching of libpcap versions affected by this issue to ensure that all register indices for scratch memory operations are validated against the maximum allowed value before execution. Developers integrating libpcap should verify they are using a patched version and consider implementing additional sanity checks in their own code if upgrading is not immediately feasible, although relying on external validation is generally discouraged due to potential race conditions or bypasses. For system administrators, it is crucial to restrict the use of packet capture capabilities to trusted applications only, as untrusted input passed directly into BPF filter compilation routines poses a direct risk. Additionally, deploying runtime application self-protection tools or memory safety monitors can help detect anomalous memory access patterns that deviate from expected behavior during network traffic analysis tasks. Long-term remediation should involve migrating away from legacy BPF interpreters where possible and adopting more modern, sandboxed packet processing frameworks that enforce strict memory isolation by design.

Responsible

Tcpdump

Reservation

01/09/2026

Disclosure

09/05/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!