CVE-2025-4802: Local Privilege Escalation in glibc Static Privileged Binary Library Loading
- Vendor
- GNU Project
CVE-2025-4802 is an untrusted library search-path vulnerability in GNU C Library (glibc) versions 2.27 through 2.38. Statically linked setuid or setgid binaries that invoke dlopen() can incorrectly honor the attacker-controlled LD_LIBRARY_PATH environment variable and load malicious shared libraries. Library loading can occur explicitly or indirectly through locale processing and Name Service Switch (NSS) functions such as getaddrinfo(). The flaw arises because unsafe environment variables are sanitized too late during static executable initialization, after library search paths have been initialized. The upstream fix, included in glibc 2.39, moves sanitization earlier in _dl_non_dynamic_init(), before _dl_init_paths(). Successful exploitation enables local code execution with the affected executable's elevated privileges.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
An attacker can execute arbitrary library code with the effective user or group privileges of a vulnerable static executable. A setuid-root executable can therefore enable root-level compromise, including unauthorized access to sensitive information, modification of protected resources, and disruption of system availability. Exploitation is local and conditional on a suitable privileged static executable; no naturally occurring vulnerable program had been identified when the upstream advisory was published, although custom programs remained a concern.
Mitigation
If you can’t patch tonight, do this now.
Until corrected binaries are available, remove unnecessary setuid or setgid privileges from affected statically linked executables, disable those executables, or restrict their execution to trusted users. Prioritize custom and third-party static privileged programs that can load libraries directly or through NSS or locale functionality. Environment sanitization performed only after vulnerable runtime initialization should not be relied upon as a workaround.
Remediation
Patch, then assume compromise.
Upgrade to glibc 2.39 or later, or install the distribution's security update containing the backported fix for CVE-2025-4802. Rebuild and redeploy affected statically linked privileged executables against the corrected glibc static libraries: updating the installed shared glibc packages alone does not replace vulnerable code embedded in existing static binaries. Obtain corrected builds from third-party suppliers where necessary, and deploy vendor-updated container images or product releases where applicable.
Exploits
1 exploit validated by Mallory's analysis.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2025-4802 exploited in the wild?
- As of Nov 20, 2026, Mallory has no reports of CVE-2025-4802 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2025-4802?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2025-4802, the earliest disclosed Jan 9, 2026.
- Is there a patch for CVE-2025-4802?
- Upgrade to glibc 2.39 or later, or install the distribution's security update containing the backported fix for CVE-2025-4802. Rebuild and redeploy affected statically linked privileged executables against the corrected glibc static libraries: updating the installed shared glibc packages alone does not replace vulnerable code embedded in existing static binaries.
- What products are affected by CVE-2025-4802?
- GNU Project Glibc.
- How severe is CVE-2025-4802?
- CVE-2025-4802 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 0.33% (18th percentile) as of Nov 20, 2026.
Recent activity
43 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.