# CVE-2024-8088: Infinite loop when iterating over zip archive entry names from zipfile.Path

> Attackers can cause a denial of service via infinite loop in Python's zipfile.Path when processing malicious archives.

- **Severity:** High 8.7 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/S:N/AU:N/R:U/RE:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Aug 2024
- **Updated:** 3 Nov 2025
- **Also known as:** ALPINE-CVE-2024-8088, ALSA-2024:9371, AZL-48114, AZL-48125, AZL-48141, BELL-CVE-2024-8088, BIT-libpython-2024-8088, BIT-python-2024-8088, BIT-python-min-2024-8088, CLEANSTART-2026-IH24407, CLSA-2024-1732700855, DEBIAN-CVE-2024-8088, GHSA-q98g-hxg3-268c, PSF-2024-10, RHSA-2024:9371, UBUNTU-CVE-2024-8088, openSUSE-SU-2024:14296-1, openSUSE-SU-2024:14297-1, openSUSE-SU-2024:14298-1, openSUSE-SU-2024:14299-1, openSUSE-SU-2024:14300-1, openSUSE-SU-2024:14301-1

## What is CVE-2024-8088?

CVE-2024-8088 is a high-severity denial of service vulnerability in CPython, published on 22 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

There is a HIGH severity vulnerability affecting the CPython "zipfile"
module affecting "zipfile.Path". Note that the more common API "zipfile.ZipFile" class is unaffected.

When iterating over names of entries in a zip archive (for example, methods
of "zipfile.Path" like "namelist()", "iterdir()", etc)
the process can be put into an infinite loop with a maliciously crafted
zip archive. This defect applies when reading only metadata or extracting
the contents of the zip archive. Programs that are not handling
user-controlled zip archives are not affected.

Weakness: CWE-835 (Loop with Unreachable Exit Condition)

## Which versions are affected by CVE-2024-8088?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6 |
| `python` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6 |
| `python-min` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6 |
| `python-unversioned-command` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python3` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python3-debug` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python3-devel` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python3-idle` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python3-libs` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python3-test` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python3-tkinter` | AlmaLinux:9 | All versions | 3.9.19-8.el9 |
| `python-unversioned-command` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.19-8.el9 |
| `python3-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.19-8.el9 |
| `python3-tkinter` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.19-8.el9 |
| `python3.9-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.19-8.el9 |
| `python3.9-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.19-8.el9 |
| `python3` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.19-8.el9 |
| `python3-libs` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.19-8.el9 |
| `python3.9` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.19-8.el9 |
| `python3.9-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.19-8.el9 |
| `python3.9-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.19-8.el9 |
| `python3` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.19-8.el9 |
| `python3-debug` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.19-8.el9 |
| `python3-idle` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.19-8.el9 |
| `python3-test` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.19-8.el9 |
| `python3-tkinter` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.19-8.el9 |
| `python3.9-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.19-8.el9 |
| `python3.9-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.19-8.el9 |
| `python310` | openSUSE:Tumbleweed | All versions | 3.10.14-7.1 |
| `python311` | openSUSE:Tumbleweed | All versions | 3.11.9-7.1 |
| `python312` | openSUSE:Tumbleweed | All versions | 3.12.5-2.1 |
| `python313` | openSUSE:Tumbleweed | All versions | 3.13.0~rc1-3.1 |
| `python38` | openSUSE:Tumbleweed | All versions | 3.8.19-8.1 |
| `python39` | openSUSE:Tumbleweed | All versions | 3.9.19-7.1 |

## How do I fix CVE-2024-8088?

Upgrade libpython to a fixed version for your release line: 3.8.20, 3.9.20, 3.10.15 or 3.11.10.

## Is CVE-2024-8088 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-8088 and fix it if it is affected.

What it is: CVE-2024-8088 is a high-severity denial of service vulnerability in CPython, published on 22 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-8088 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6
- python (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6
- python-min (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6

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

## Sources

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

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