# CVE-2025-4802: Privilege escalation in glibc

> Attackers can escalate privileges by exploiting untrusted LD_LIBRARY_PATH in statically compiled setuid binaries using glibc.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 16 May 2025
- **Updated:** 26 Feb 2026
- **Also known as:** ALSA-2025:8655, ALSA-2025:8686, AZL-61873, AZL-61877, BELL-CVE-2025-4802, CLSA-2025-1750416241, CLSA-2025-1750692029, CLSA-2025-1750697072, CLSA-2025-1750784684, CLSA-2025-1751891683, CLSA-2025-1757690477, CLSA-2025-1757700003, CLSA-2025-1758892548, CLSA-2026-1787213464, DEBIAN-CVE-2025-4802, DLA-4181-1, ECHO-9557-5d0c-3a13, GHSA-8mm9-c4mg-vfjh, MGASA-2025-0164, MINI-7c3m-qhhf-4gj8, OESA-2025-1581, RHSA-2025:10219, RHSA-2025:10220, RHSA-2025:8655, RHSA-2025:8686, RHSA-2025:9336, RLSA-2025:8655, RLSA-2025:8686, SUSE-SU-2025:01702-1, SUSE-SU-2025:01702-2, SUSE-SU-2025:01784-1, SUSE-SU-2025:20332-1, SUSE-SU-2025:20361-1, UBUNTU-CVE-2025-4802, USN-7541-1, openSUSE-SU-2025:15697-1

## What is CVE-2025-4802?

CVE-2025-4802 is a high-severity vulnerability in Gnu Glibc, published on 16 May 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Untrusted LD_LIBRARY_PATH environment variable vulnerability in the GNU C Library version 2.27 to 2.38 allows attacker controlled loading of dynamically shared library in statically compiled setuid binaries that call dlopen (including internal dlopen calls after setlocale or calls to NSS functions such as getaddrinfo).

Weakness: CWE-426 (Untrusted Search Path)

## Which versions are affected by CVE-2025-4802?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `compat-libpthread-nonshared` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-all-langpacks` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-benchtests` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-common` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-devel` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-doc` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-gconv-extra` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-headers` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-aa` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-af` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-agr` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-ak` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-am` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-an` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-anp` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-ar` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-as` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-ast` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-ayc` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-az` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-be` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bem` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-ber` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bg` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bhb` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bho` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bi` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bn` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bo` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-br` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-brx` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-bs` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-byn` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-ca` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-ce` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-chr` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-cmn` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-crh` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |
| `glibc-langpack-cs` | AlmaLinux:8 | All versions | 2.28-251.el8_10.22 |

Products: Gnu Glibc.

## How do I fix CVE-2025-4802?

Apply the vendor's patch.

## Is CVE-2025-4802 being exploited?

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

Public exploit code:

- Proof of Concept for a statically compiled setuid binary vulnerable to dlopen with LD_LIBRARY_PATH (github_poc): https://github.com/betizzel/CVE-2025-4802-Proof-of-Concept

## Other vulnerabilities in Gnu Glibc

- [CVE-2026-5450](https://insights.sbomify.com/CVE-2026-5450/): scanf %mc off-by-one heap buffer overflow (critical 9.8)
- [CVE-2023-25139](https://insights.sbomify.com/CVE-2023-25139/): Memory corruption in n/a (critical 9.8)
- [CVE-1999-0199](https://insights.sbomify.com/CVE-1999-0199/): Other in n/a (critical 9.8)
- [CVE-2019-1010022](https://insights.sbomify.com/CVE-2019-1010022/): Security feature bypass in glibc (critical 9.8)
- [CVE-2005-3590](https://insights.sbomify.com/CVE-2005-3590/): Memory corruption in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-4802 and fix it if it is affected.

What it is: CVE-2025-4802 is a high-severity vulnerability in Gnu Glibc, published on 16 May 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-4802 in the wild and no public exploit code.

Affected product: Gnu Glibc. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-4802/ (Markdown: https://insights.sbomify.com/CVE-2025-4802/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-4802
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-4802
- OSV: https://osv.dev/vulnerability/CVE-2025-4802

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-4802/
Summaries are generated and may contain mistakes; the official description above is the record.
