# CVE-2025-0395: Memory corruption in glibc

> A buffer overflow in glibc's assert() function can lead to code execution or denial of service when assertion messages align with page boundaries.

- **Severity:** Medium 6.2 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Jan 2025
- **Updated:** 15 Oct 2026
- **Also known as:** ALSA-2025:3828, ALSA-2025:4244, AZL-55937, AZL-55965, BELL-CVE-2025-0395, CLSA-2025-1740230107, CLSA-2025-1740470259, CLSA-2025-1760373685, CLSA-2025-1760460711, CLSA-2025-1760542306, CLSA-2025-1760966342, DEBIAN-CVE-2025-0395, DLA-4143-1, ECHO-3bf9-421a-e851, GHSA-4xpw-6594-8f5m, MGASA-2025-0026, MINI-3fpw-5gjp-6qmx, MINI-4hff-6j5q-cp3r, MINI-f6f6-f4j3-4j9h, OESA-2025-1242, RHSA-2025:3828, RHSA-2025:4241, RHSA-2025:4242, RHSA-2025:4243, RHSA-2025:4244, RLSA-2025:3828, RLSA-2025:4244, SUSE-SU-2025:0510-1, SUSE-SU-2025:0562-1, SUSE-SU-2025:0582-1, SUSE-SU-2025:20135-1, SUSE-SU-2025:20236-1, UBUNTU-CVE-2025-0395, USN-7259-1, USN-7259-2, USN-7259-3, openSUSE-SU-2025:14851-1

## What is CVE-2025-0395?

CVE-2025-0395 is a medium-severity memory corruption vulnerability in The GNU C Library glibc, published on 22 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

When the assert() function in the GNU C Library versions 2.13 to 2.40 fails, it does not allocate enough space for the assertion failure message string and size information, which may lead to a buffer overflow if the message string size aligns to page size.

Weakness: CWE-131 (Incorrect Calculation of Buffer Size)

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


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

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

Apply the vendor's patch.

## Is CVE-2025-0395 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-0395 exists.

## Fix prompt for AI coding agents

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

What it is: CVE-2025-0395 is a medium-severity memory corruption vulnerability in The GNU C Library glibc, published on 22 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-0395 exists.

Affected product: The GNU C Library 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-0395/ (Markdown: https://insights.sbomify.com/CVE-2025-0395/index.md)
```

## Sources

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

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