# CVE-2026-31413: bpf: Fix unsound scalar forking in maybe\_fork\_scalars() for BPF\_OR

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.18% (percentile 5, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2026-04-12T05:36:14.632Z
- **Modified:** 2026-08-05T12:22:19.762Z

## Who should check

- Anyone running Linux \>= dea9989a3f3961faede93752cd81eb5a9514d911, \< 342aa1ee995ef5bbf876096dc3a5e51218d76fa4; \>= 4c122e8ae14950cf6b59d208fc5160f7c601e746, \< 58bd87d0e69204dbd739e4387a1edb0c4b1644e7; \>= e52567173ba86dbffb990595fbe60e2e83899372, \< d13281ae7ea8902b21d99d10a2c8caf0bdec0455; \>= bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7, \< c845894ebd6fb43226b3118d6b017942550910c5
- Anyone running Linux \>= 6.12.75, \< 6.12.80; \>= 6.18.16, \< 6.18.21; \>= 6.19.6, \< 6.19.11

## Description

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 and fixed versions

- Linux: \>= dea9989a3f3961faede93752cd81eb5a9514d911, \< 342aa1ee995ef5bbf876096dc3a5e51218d76fa4; \>= 4c122e8ae14950cf6b59d208fc5160f7c601e746, \< 58bd87d0e69204dbd739e4387a1edb0c4b1644e7; \>= e52567173ba86dbffb990595fbe60e2e83899372, \< d13281ae7ea8902b21d99d10a2c8caf0bdec0455; \>= bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7, \< c845894ebd6fb43226b3118d6b017942550910c5 (cvelist)
- Linux: \>= 6.12.75, \< 6.12.80; \>= 6.18.16, \< 6.18.21; \>= 6.19.6, \< 6.19.11 (cvelist)

## Mitigation

- Upgrade Linux to 6.19.11 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-31413. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-31413.md
Affected: Linux >= dea9989a3f3961faede93752cd81eb5a9514d911, < 342aa1ee995ef5bbf876096dc3a5e51218d76fa4; >= 4c122e8ae14950cf6b59d208fc5160f7c601e746, < 58bd87d0e69204dbd739e4387a1edb0c4b1644e7; >= e52567173ba86dbffb990595fbe60e2e83899372, < d13281ae7ea8902b21d99d10a2c8caf0bdec0455; >= bffacdb80b93b7b5e96b26f…
Fixed in: Linux 342aa1ee995ef5bbf876096dc3a5e51218d76fa4, Linux 58bd87d0e69204dbd739e4387a1edb0c4b1644e7, Linux 6.12.80, Linux 6.18.21, Linux 6.19.11

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-31413 being exploited?

There is no confirmed exploitation: CVE-2026-31413 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.18% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-31413?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-31413?

Linux \>= dea9989a3f3961faede93752cd81eb5a9514d911, \< 342aa1ee995ef5bbf876096dc3a5e51218d76fa4; \>= 4c122e8ae14950cf6b59d208fc5160f7c601e746, \< 58bd87d0e69204dbd739e4387a1edb0c4b1644e7; \>= e52567173ba86dbffb990595fbe60e2e83899372, \< d13281ae7ea8902b21d99d10a2c8caf0bdec0455; \>= bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7, \< c845894ebd6fb43226b3118d6b017942550910c5; Linux \>= 6.12.75, \< 6.12.80; \>= 6.18.16, \< 6.18.21; \>= 6.19.6, \< 6.19.11.

### Is there a fix for CVE-2026-31413?

Yes. Fixed in Linux 342aa1ee995ef5bbf876096dc3a5e51218d76fa4, Linux 58bd87d0e69204dbd739e4387a1edb0c4b1644e7, Linux 6.12.80, Linux 6.18.21, Linux 6.19.11. Upgrade Linux to 6.19.11 or later.

### How do I check if I'm affected by CVE-2026-31413?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/342aa1ee995ef5bbf876096dc3a5e51218d76fa4>
- patch: <https://git.kernel.org/stable/c/58bd87d0e69204dbd739e4387a1edb0c4b1644e7>
- patch: <https://git.kernel.org/stable/c/d13281ae7ea8902b21d99d10a2c8caf0bdec0455>
- patch: <https://git.kernel.org/stable/c/c845894ebd6fb43226b3118d6b017942550910c5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-31413>

HTML: <https://flawdb.com/CVE-2026-31413> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-31413>
