# CVE-2025-15504: lief-project LIEF ELF Binary Parser.tcc parse_binary null pointer dereference

> A local attacker can cause a denial of service in the LIEF library via a null pointer dereference in the ELF parser.

- **Severity:** Medium 4.8 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P`)
- **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:** Yes
- **Published:** 10 Jan 2026
- **Updated:** 23 Feb 2026
- **Also known as:** GHSA-mjjp-xjfg-97wg, PYSEC-2026-1538

## What is CVE-2025-15504?

CVE-2025-15504 is a medium-severity vulnerability in lief-project LIEF, published on 10 Jan 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

A security flaw has been discovered in lief-project LIEF up to 0.17.1. Affected by this issue is the function Parser::parse_binary of the file src/ELF/Parser.tcc of the component ELF Binary Parser. The manipulation results in null pointer dereference. The attack must be initiated from a local position. The exploit has been released to the public and may be used for attacks. Upgrading to version 0.17.2 can resolve this issue. The patch is identified as 81bd5d7ea0c390563f1c4c017c9019d154802978. It is recommended to upgrade the affected component.

Weakness: CWE-476 (NULL Pointer Dereference), CWE-404 (Improper Resource Shutdown or Release)

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

5 open source packages ship an affected version, including lief. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `lief` | PyPI | All versions | 0.17.2 |
| `lief` | PyPI | All versions | 0.17.2 |
| `lief` | PyPI | All versions | 0.17.2 |
| `lief` | crates.io | All versions | 0.17.2 |
| `lief` | crates.io | All versions | 0.17.2 |

Products: Lief-Project Lief.

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

Upgrade lief to 0.17.2 or later.

## Is CVE-2025-15504 being exploited?

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

## Other vulnerabilities in lief-project LIEF

- [CVE-2021-32297](https://insights.sbomify.com/CVE-2021-32297/): LIEF heap-buffer-overflow (high 8.8)
- [CVE-2022-38306](https://insights.sbomify.com/CVE-2022-38306/): LIEF vulnerable to heap based buffer overflow (high 7.8)
- [CVE-2022-38495](https://insights.sbomify.com/CVE-2022-38495/): LIEF vulnerable to heap based buffer overflow via print_binary function (high 7.8)
- [CVE-2022-43171](https://insights.sbomify.com/CVE-2022-43171/): LIEF heap buffer overflow in the LIEF::MachO::BinaryParser::parse_dyldinfo_generic_bind (medium 6.5)
- [CVE-2022-40922](https://insights.sbomify.com/CVE-2022-40922/): LIEF vulnerable to denial of service through segmentation fault (medium 6.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-15504 is a medium-severity vulnerability in lief-project LIEF, published on 10 Jan 2026. 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-15504 exists.

Affected packages and fixed versions:
- lief (PyPI): affected all versions; fixed in 0.17.2
- lief (PyPI): affected all versions; fixed in 0.17.2
- lief (PyPI): affected all versions; fixed in 0.17.2
- lief (crates.io): affected all versions; fixed in 0.17.2
- lief (crates.io): affected all versions; fixed in 0.17.2

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-15504/ (Markdown: https://insights.sbomify.com/CVE-2025-15504/index.md)
```

## Sources

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

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