CVE-2026-31401 HID: bpf: prevent buffer overflow in hid_hw_request

High 7.8 Published Updated

A buffer overflow in the Linux kernel's HID-BPF subsystem allows attackers to execute arbitrary code or escalate privileges via crafted HID requests.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2026-31401?

CVE-2026-31401 is a high-severity memory corruption vulnerability in Linux kernel, published on 3 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

HID: bpf: prevent buffer overflow in hid_hw_request

right now the returned value is considered to be always valid. However, when playing with HID-BPF, the return value can be arbitrary big, because it's the return value of dispatch_hid_bpf_raw_requests(), which calls the struct_ops and we have no guarantees that the value makes sense.

Weakness: CWE-787, CWE-120

Which versions are affected by CVE-2026-31401?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2026-31401?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2026-31401 being exploited?

There is no known exploitation of CVE-2026-31401 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2026-31401, DEBIAN-CVE-2026-31401, GHSA-whg2-hqg5-6ph3, ROOT-OS-DEBIAN-13-CVE-2026-31401, UBUNTU-CVE-2026-31401.

Is CVE-2026-31401 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free