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

Medium 4.3 Published Updated

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

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

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

Which versions are affected by CVE-2025-8291?

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

PackageAffectedFixed in
libpython BitnamiAll versions3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1
python BitnamiAll versions3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1
python-min BitnamiAll versions3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.10, 3.14.1
Linux distribution packages (37)
python-unversioned-command AlmaLinux:10All versions3.12.12-1.el10_1
python3.12 AlmaLinux:9All versions3.12.12-1.el9_7
python3.12-debug AlmaLinux:9All versions3.12.12-1.el9_7
python3.12-devel AlmaLinux:9All versions3.12.12-1.el9_7
python3.12-idle AlmaLinux:9All versions3.12.12-1.el9_7
python3.12-libs AlmaLinux:9All versions3.12.12-1.el9_7
python3.12-test AlmaLinux:9All versions3.12.12-1.el9_7
python3.12-tkinter AlmaLinux:9All versions3.12.12-1.el9_7
python-unversioned-command Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3 Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3-debug Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3-devel Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3-idle Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3-libs Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3-test Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3-tkinter Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3.12 Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3.12-debuginfo Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3.12-debugsource Red Hat:enterprise_linux:10.1All versions0:3.12.12-1.el10_1
python3.12 Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.12-1.el9_7
python3.12-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.12-1.el9_7
python3.12-debugsource Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.12-1.el9_7
python3.12-devel Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.12-1.el9_7
python3.12-libs Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.12-1.el9_7
python3.12-tkinter Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.12-1.el9_7
python3.12 Red Hat:enterprise_linux:9::crbAll versions0:3.12.12-1.el9_7
python3.12-debug Red Hat:enterprise_linux:9::crbAll versions0:3.12.12-1.el9_7
python3.12-debuginfo Red Hat:enterprise_linux:9::crbAll versions0:3.12.12-1.el9_7
python3.12-debugsource Red Hat:enterprise_linux:9::crbAll versions0:3.12.12-1.el9_7
python3.12-idle Red Hat:enterprise_linux:9::crbAll versions0:3.12.12-1.el9_7
python3.12-test Red Hat:enterprise_linux:9::crbAll versions0:3.12.12-1.el9_7
python3.12-tkinter Red Hat:enterprise_linux:9::crbAll versions0:3.12.12-1.el9_7
python-unversioned-command Red Hat:enterprise_linux_eus:10.0All versions0:3.12.9-2.el10_0.4
python3 Red Hat:enterprise_linux_eus:10.0All versions0:3.12.9-2.el10_0.4
python3-debug Red Hat:enterprise_linux_eus:10.0All versions0:3.12.9-2.el10_0.4
python3-devel Red Hat:enterprise_linux_eus:10.0All versions0:3.12.9-2.el10_0.4
python3-idle Red Hat:enterprise_linux_eus:10.0All versions0: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.

Sources

Also known as ALSA-2025:23323, ALSA-2025:23940, AZL-110507, AZL-68318, AZL-68321, BIT-libpython-2025-8291 and 27 more.

Is CVE-2025-8291 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free