# CVE-2026-41140: Poetry: Path traversal in tar extraction on Python 3.10.0 - 3.10.12 and 3.11.0 - 3.11.4

> Attackers can exploit path traversal in Poetry's tar extraction to write files outside the intended directory, potentially leading to code execution.

- **Severity:** Low 0.6 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U`)
- **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:** 24 Apr 2026
- **Updated:** 15 Jul 2026
- **Also known as:** AZL-84035, DEBIAN-CVE-2026-41140, GHSA-73h3-mf4w-8647, MINI-fg5x-hfh7-2v7w, PYSEC-2026-2890, ROOT-APP-PYPI-CVE-2026-41140, UBUNTU-CVE-2026-41140

## What is CVE-2026-41140?

CVE-2026-41140 is a low-severity path traversal vulnerability in python-poetry poetry, published on 24 Apr 2026. 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

Poetry is a dependency manager for Python. Prior to 2.3.4, the extractall() function in src/poetry/utils/helpers.py:410-426 extracts sdist tarballs without path traversal protection on Python versions where tarfile.data_filter is unavailable. Considering only Python versions which are still supported by Poetry, these are 3.10.0 - 3.10.12 and 3.11.0 - 3.11.4. This vulnerability is fixed in 2.3.4.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-41140?

3 open source packages ship an affected version, including poetry.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `poetry` | PyPI | All versions | 2.3.4 |
| `poetry` | PyPI | All versions | 2.3.4 |
| `poetry` | PyPI | All versions | 2.3.4 |

## How do I fix CVE-2026-41140?

Upgrade poetry to 2.3.4 or later.

## Is CVE-2026-41140 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41140 and fix it if it is affected.

What it is: CVE-2026-41140 is a low-severity path traversal vulnerability in python-poetry poetry, published on 24 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-41140 in the wild and no public exploit code.

Affected packages and fixed versions:
- poetry (PyPI): affected all versions; fixed in 2.3.4
- poetry (PyPI): affected all versions; fixed in 2.3.4
- poetry (PyPI): affected all versions; fixed in 2.3.4

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

## Sources

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

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