Linux Kernel
CVE-2024-27050
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain local low-privilege access
-
DeliveryTrigger execution of older-ABI libbpf binary
-
ExploitCall bpf_xdp_query() with undersized opts struct
-
ExecutionUnpatched libbpf writes fields beyond struct boundary
-
PersistCorrupt adjacent stack memory in calling process
-
ImpactHijack control flow for privilege escalation
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a specific ABI mismatch: a program binary compiled against an older version of libbpf (where bpf_xdp_query_opts does not include the feature_flags or xdp_zc_max_segs fields) must call bpf_xdp_query() at runtime against a newer, unpatched libbpf that unconditionally writes those fields. This condition is not present in standard same-version deployments where the program and libbpf are compiled together or against matching headers. The CVSS vector (AV:L/PR:L) confirms local, authenticated access is required; remote exploitation is not possible. Additionally, the triggering code path is limited to programs that explicitly invoke bpf_xdp_query() with an opts struct - deployments that do not use XDP querying via libbpf are entirely unaffected. The ABI mismatch condition is most likely to arise during kernel or libbpf upgrades in environments where pre-built binaries are not simultaneously recompiled. |
| Impact | The CVSS 7.8 vector (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) reflects a worst-case scenario: a local low-privileged user triggers stack corruption in a privileged process, potentially escalating to full control. However, real-world risk is substantially lower than the raw score implies. EPSS of 0.27% (19th percentile) signals minimal observed exploitation interest. The vulnerability is absent from CISA KEV, and no public exploit or POC has been identified at time of analysis. Critically, exploitation requires a specific ABI mismatch - a program compiled against an older libbpf must call bpf_xdp_query() against a newer runtime that lacks the OPTS_SET() fix. This condition arises most plausibly during kernel or libbpf upgrades where binaries are not recompiled, rather than through deliberate attacker configuration. The NVD's AC:L rating may overstate ease; the ABI mismatch precondition is a non-trivial environmental requirement. Overall, this is primarily a stability and reliability concern for environments undergoing libbpf version transitions, not an active exploitation priority. |
| Exploit ScenarioDerived | A local attacker with low privileges executes, or induces execution of, an XDP-management program compiled against an older libbpf where bpf_xdp_query_opts lacks the feature_flags or xdp_zc_max_segs fields. When this binary calls bpf_xdp_query() against a newer, unpatched libbpf runtime, libbpf unconditionally writes those fields beyond the caller's struct boundary, corrupting adjacent stack data. If the victim process runs with elevated privileges - for example, a network management daemon - the stack corruption could overwrite a return address or function pointer, enabling privilege escalation; no public POC has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv3 – Aug 04, 2026
Stack corruption in Linux kernel libbpf's bpf_xdp_query() function can corrupt adjacent stack memory in programs that call this API with an older libbpf ABI. The root cause is the absence of the OPTS_SET() macro when writing feature_flags and xdp_zc_max_segs to bpf_xdp_query_opts, causing unconditional out-of-bounds writes into callers compiled against a smaller version of the struct. No public exploit has been identified and EPSS sits at 0.27%, but the CVSS 7.8 High rating reflects the potential for full privilege escalation via stack corruption in a local context.
Earlier versions of this analysis (2)
Stack corruption in the Linux kernel's libbpf bpf_xdp_query() function can allow local low-privileged attackers to corrupt stack memory in programs that call this function, potentially enabling privilege escalation. The flaw stems from two new fields (feature_flags and xdp_zc_max_segs) being written to the bpf_xdp_query_opts struct unconditionally - without the OPTS_SET() ABI guard macro - so programs compiled against older libbpf headers have their stack corrupted when the newer libbpf writes beyond the allocated struct boundary. No public exploit has been identified at time of analysis, and the EPSS score of 0.27% (19th percentile) reflects the low real-world exploitation probability despite the 7.8 CVSS score.
Stack corruption in the Linux kernel's libbpf bpf_xdp_query() function allows a local low-privileged attacker to trigger out-of-bounds memory writes, potentially leading to privilege escalation. The flaw stems from missing OPTS_SET() macro guards when writing the feature_flags and xdp_zc_max_segs fields to the bpf_xdp_query_opts struct - programs compiled against an older libbpf (with a smaller struct layout) will have stack memory written beyond their struct boundary. No public exploit code or active exploitation has been identified at time of analysis; EPSS is notably low at 0.27% (19th percentile).
RemediationAI
Apply the upstream kernel patches from the four stable-branch commits available at https://git.kernel.org/stable/c/682ddd62abd4bdcee7584246903e7a2df005fe0d, https://git.kernel.org/stable/c/92a871ab9fa59a74d013bc04f321026a057618e7, https://git.kernel.org/stable/c/cd3be9843247edb8fc6fcd8d8237cbce2bc19f5e, and https://git.kernel.org/stable/c/fa5bef5e80c6a3321b2b1a7070436f3bc5daf07c. Distribution vendors (Red Hat, Ubuntu, Debian, SUSE) will typically backport these into their stable kernel packages; applying the latest kernel update from your distribution is the recommended path. Note: the exact patched kernel release version number is not independently confirmed from available data - verify with your distribution's security advisory. As a compensating control in environments that cannot immediately update, ensure all programs invoking bpf_xdp_query() are recompiled and relinked against the same libbpf version present at runtime; this eliminates the ABI size mismatch that triggers the out-of-bounds write, though it does not fix the underlying library defect. Restricting execution of XDP-querying programs to trusted users via capability controls (CAP_NET_ADMIN or CAP_SYS_ADMIN as appropriate) reduces exposure surface but does not remediate the vulnerability.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability resides in libbpf, the userspace BPF (Berkeley Packet Filter) library shipped with the Linux kernel, specifically in the bpf_xdp_query() function used to query XDP (eXpress Data Path) interface settings. When the feature_flags and xdp_zc_max_segs fields were introduced to the bpf_xdp_query_opts struct, the implementation wrote to them without using the OPTS_SET() macro. OPTS_SET() internally relies on OPTS_HAS() to verify that the caller's struct size includes the target field before writing - a critical backward-compatibility guard for libbpf's versioned opts pattern. Skipping this guard causes libbpf to write beyond the caller's struct boundary, corrupting whatever lies adjacent on the stack. CWE-787 (Out-of-Bounds Write) precisely classifies the root cause. Affected products span the Linux kernel across multiple stable branches per CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
ABI mismatch between binary and runtime is a non-default environmental precondition justifying AC:H; local low-privilege access confirmed by description and CVSS vector.
Primary rating from Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67).
CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Lifecycle Timeline
6DescriptionCVE.org
In the Linux kernel, the following vulnerability has been resolved:
libbpf: Use OPTS_SET() macro in bpf_xdp_query()
When the feature_flags and xdp_zc_max_segs fields were added to the libbpf bpf_xdp_query_opts, the code writing them did not use the OPTS_SET() macro. This causes libbpf to write to those fields unconditionally, which means that programs compiled against an older version of libbpf (with a smaller size of the bpf_xdp_query_opts struct) will have its stack corrupted by libbpf writing out of bounds.
The patch adding the feature_flags field has an early bail out if the feature_flags field is not part of the opts struct (via the OPTS_HAS) macro, but the patch adding xdp_zc_max_segs does not. For consistency, this fix just changes the assignments to both fields to use the OPTS_SET() macro.
Executive ViewAI
CVE-2024-27050 introduces a memory corruption vulnerability in Linux kernel libbpf that enables local privilege escalation, affecting any organization running systems or containers with vulnerable versions. Threat actors gaining local system access could exploit stack corruption to achieve root-level system compromise, creating significant risk for development systems, CI/CD infrastructure, and cloud workloads.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
NVD
CVE.org
EPSS
VulDB
GitHub PoC
Exploit-DB