CVE-2026-31413
High · 7.8CVSS
7.8
EPSS
0.2%
Published
Apr 12, 2026
CISA due date
—
Cloudanix analysis
A bug in the Linux kernel's BPF verifier lets specially written programs trick the system into allowing unsafe memory access, which a local user could abuse to take control or crash the machine.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Privilege Gain
- Component
- OS kernel
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The BPF verifier's maybe_fork_scalars() function incorrectly forks scalar state for BPF_OR when the destination register holds the signed range [-1, 0], causing the pushed path to track dst as 0 while the runtime value is actually K; this verifier/runtime divergence permits out-of-bounds BPF map accesses.
Why it matters to the business
Local attackers on Linux systems can achieve memory corruption leading to privilege escalation or system instability, impacting the security of any environment relying on unpatched kernels with BPF programs.
How an attack unfolds
An attacker loads a crafted BPF program containing an ALU BPF_OR instruction where the destination register's tracked range is [-1, 0]; the flawed forking logic in maybe_fork_scalars() produces an incorrect verifier state on the pushed path, allowing subsequent map accesses that exceed allocated bounds at runtime.
How to fix it
Apply the upstream kernel fix that changes the push_stack() call in maybe_fork_scalars() to pass env->insn_idx instead of env->insn_idx + 1 so the pushed path correctly re-evaluates the ALU instruction; upgrade to a kernel release containing this commit.
How to confirm the fix worked
Verify the presence of the corrected push_stack() argument in the kernel source; confirm that BPF verifier tests covering BPF_OR with negative scalar ranges now produce consistent results; test crafted programs no longer permit out-of-bounds map accesses.
Typical attack path
- Compile and load a BPF program via bpf() syscall that exercises BPF_OR with a constant source operand and dst range [-1, 0]
- Trigger verifier state forking via maybe_fork_scalars()
- Perform map lookup or update operations that the verifier accepts but that read or write beyond the map bounds at runtime
- Escalate privileges or cause denial of service via the resulting memory corruption
How to detect it
Review kernel audit logs and BPF verifier error messages for unexpected scalar forking behavior; inspect loaded BPF programs for ALU_OR instructions paired with registers that can hold negative values; look for runtime map access violations or oops reports referencing bpf_map areas.
What your security team should do
- Prioritize kernel upgrades on all systems that compile or run untrusted BPF programs
- Monitor upstream stable branches for backported fixes given the kernel's high ecosystem prevalence
- Restrict unprivileged BPF loading via sysctl until patches are deployed
The record
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR maybe_fork_scalars() is called for both BPF_AND and BPF_OR when the source operand is a constant. When dst has signed range [-1, 0], it forks the verifier state: the pushed path gets dst = 0, the current path gets dst = -1. For BPF_AND this is correct: 0 & K == 0. For BPF_OR this is wrong: 0 | K == K, not 0. The pushed path therefore tracks dst as 0 when the runtime value is K, producing an exploitable verifier/runtime divergence that allows out-of-bounds map access. Fix this by passing env->insn_idx (instead of env->insn_idx + 1) to push_stack(), so the pushed path re-executes the ALU instruction with dst = 0 and naturally computes the correct result for any opcode.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-62958 libriscv is a RISC-V sandbox and emulator. CWE-125
- CVE-2026-119338 Tesseract is an open source OCR engine. CWE-125
- CVE-2026-119299 gopacket provides packet processing capabilities for Go. CWE-125
- CVE-2026-119722 Blender before 4.5.15 and 5.x before 5.2.3 contains a heap out-of-bounds access… CWE-125
- CVE-2026-119721 Blender before 4.5.15 and 5.x before 5.2.3 contains an out-of-bounds read vulnerability… CWE-125
- CVE-2026-119720 Blender before 4.5.15 and 5.x before 5.2.3 contains a heap out-of-bounds read… CWE-125
- CVE-2026-104063 Scribus before 1.6.7 contains an out-of-bounds read vulnerability in the Mac PICT image… CWE-125
- CVE-2026-61627 libass is a portable subtitle renderer for the `ASS`/SSA (Advanced Substation… CWE-125