# CVE-2025-8291: ZIP64 End of Central Directory (EOCD) Locator record offset not checked

> Attackers can craft ZIP files causing inconsistent parsing between Python and other tools, potentially leading to security bypasses or logic errors.

- **Severity:** Medium 4.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 7 Oct 2025
- **Updated:** 31 Jul 2026
- **Also known as:** ALSA-2025:23323, ALSA-2025:23940, AZL-110507, AZL-68318, AZL-68321, BIT-libpython-2025-8291, BIT-python-2025-8291, BIT-python-min-2025-8291, CLEANSTART-2026-KH84979, DEBIAN-CVE-2025-8291, ECHO-37a0-326b-4e55, GHSA-49g5-f6qw-8mm7, GHSA-hhv7-p4pg-wm6p, MINI-2cgr-58w5-438j, MINI-f23m-2chc-2rhj, MINI-mhxg-2jw6-23p3, MINI-mw39-8f9f-rcgh, MINI-w4ww-vmw7-42mf, OESA-2025-2575, OESA-2025-2576, OESA-2025-2577, OESA-2025-2578, OESA-2025-2706, PSF-2025-12, RHSA-2025:23323, RHSA-2025:23940, RHSA-2026:0353, RHSA-2026:0354, RHSA-2026:0355, RLSA-2025:23323, RLSA-2025:23940, SUSE-SU-2025:4313-1, UBUNTU-CVE-2025-8291

## What is CVE-2025-8291?

CVE-2025-8291 is a medium-severity vulnerability in CPython, published on 7 Oct 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

The 'zipfile' module would not check the validity of the ZIP64 End of
Central Directory (EOCD) Locator record offset value would not be used to
locate the ZIP64 EOCD record, instead the ZIP64 EOCD record would be
assumed to be the previous record in the ZIP archive. This could be abused
to create ZIP archives that are handled differently by the 'zipfile' module
compared to other ZIP implementations.

Remediation maintains this behavior, but checks that the offset specified
in the ZIP64 EOCD Locator record matches the expected value.

Weakness: CWE-1285 (Improper Validation of Specified Index, Position, or Offset in Input)

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

3 open source packages ship an affected version, including libpython, python and python-min.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1 |
| `python` | Bitnami | All versions | 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1 |
| `python-min` | Bitnami | All versions | 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1 |
| `python-unversioned-command` | AlmaLinux:10 | All versions | 3.12.12-1.el10_1 |
| `python3.12` | AlmaLinux:9 | All versions | 3.12.12-1.el9_7 |
| `python3.12-debug` | AlmaLinux:9 | All versions | 3.12.12-1.el9_7 |
| `python3.12-devel` | AlmaLinux:9 | All versions | 3.12.12-1.el9_7 |
| `python3.12-idle` | AlmaLinux:9 | All versions | 3.12.12-1.el9_7 |
| `python3.12-libs` | AlmaLinux:9 | All versions | 3.12.12-1.el9_7 |
| `python3.12-test` | AlmaLinux:9 | All versions | 3.12.12-1.el9_7 |
| `python3.12-tkinter` | AlmaLinux:9 | All versions | 3.12.12-1.el9_7 |
| `python-unversioned-command` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3-debug` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3-devel` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3-idle` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3-libs` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3-test` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3-tkinter` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3.12` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3.12-debuginfo` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3.12-debugsource` | Red Hat:enterprise_linux:10.1 | All versions | 0:3.12.12-1.el10_1 |
| `python3.12` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-libs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-tkinter` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-1.el9_7 |
| `python3.12` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-debug` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-idle` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-test` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-1.el9_7 |
| `python3.12-tkinter` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-1.el9_7 |
| `python-unversioned-command` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.12.9-2.el10_0.4 |
| `python3` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.12.9-2.el10_0.4 |
| `python3-debug` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.12.9-2.el10_0.4 |
| `python3-devel` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.12.9-2.el10_0.4 |
| `python3-idle` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.12.9-2.el10_0.4 |

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

Upgrade libpython to a fixed version for your release line: 3.9.24, 3.10.19, 3.11.14 or 3.12.12.

## Is CVE-2025-8291 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2025-8291 is a medium-severity vulnerability in CPython, published on 7 Oct 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-8291 exists.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1
- python (Bitnami): affected all versions; fixed in 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1
- python-min (Bitnami): affected all versions; fixed in 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1

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

## Sources

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

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