CVE-2024-50262 bpf: Fix out-of-bounds write in trie_get_next_key()

High 7.8 Published Updated

An out-of-bounds write in the Linux kernel BPF trie implementation allows attackers to corrupt memory, potentially leading to code execution or privilege escalation.

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-2024-50262?

CVE-2024-50262 is a high-severity memory corruption vulnerability in Linux kernel, published on 9 Nov 2024. 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:

bpf: Fix out-of-bounds write in trie_get_next_key()

trie_get_next_key() allocates a node stack with size trie->max_prefixlen, while it writes (trie->max_prefixlen + 1) nodes to the stack when it has full paths from the root to leaves. For example, consider a trie with max_prefixlen is 8, and the nodes with key 0x00/0, 0x00/1, 0x00/2, ... 0x00/8 inserted. Subsequent calls to trie_get_next_key with _key with .prefixlen = 8 make 9 nodes be written on the node stack with size 8.

Weakness: CWE-787

Which versions are affected by CVE-2024-50262?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-50262?

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-2024-50262 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-53042, AZL-53099, BELL-CVE-2024-50262, DEBIAN-CVE-2024-50262, GHSA-m4m9-v4mx-256j, UBUNTU-CVE-2024-50262.

Is CVE-2024-50262 in your software?

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

Check your SBOMs for free