# CVE-2026-41140: Poetry path traversal in sdist extraction

Source: https://junglewise.ai/threats/cve-2026-41140-poetry-path-traversal-in-sdist-extraction  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-04-24. Updated: 2026-06-30  
License: CC BY 4.0 with a link back

CVE-2026-41140 · Severity: high · CVSS 8.7 · Published 2026-04-24

Poetry, a popular tool for managing Python software dependencies, contains a security flaw that could allow a malicious package to write files to unauthorized locations on a user's computer. This occurs when Poetry processes certain types of package files (tarballs) on specific older versions of Python. An attacker could use this to overwrite sensitive system files or plant malicious code, potentially compromising the developer's workstation or automated build environments.

Technologies: [poetry (PyPI)](https://junglewise.ai/threats/technologies/poetry). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-41140 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-41140 being exploited in the wild.

**How severe is CVE-2026-41140?** High severity, with a CVSS score of 8.7, published 24 April 2026.

**Which products and versions are affected?** poetry (PyPI) < 2.3.4, ECOSYSTEM:introduced=0,fixed=2.3.4.

**Is there a fix for CVE-2026-41140?** Yes. poetry (PyPI): upgrade to 2.3.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-41140 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-41140?** Check whether you run poetry (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- poetry (PyPI): upgrade to 2.3.4 or later

  ```sh
  pip install "poetry>=2.3.4"
  ```


## Technical details

A path traversal vulnerability exists in Poetry's 'extractall' function within 'src/poetry/utils/helpers.py'. The issue occurs when Poetry extracts source distribution (sdist) tarballs on Python environments where 'tarfile.data_filter' is unavailable or broken (specifically Python 3.10.0-3.10.12 and 3.11.0-3.11.4). An attacker can craft a malicious tarball containing members with '../' sequences, symlinks, or hardlinks to write files outside the intended extraction directory. This can be triggered during dependency resolution (e.g., 'poetry lock') or installation. The vulnerability is addressed in Poetry version 2.3.4 by implementing manual path validation for all archive members.

## Affected products

- python-poetry Poetry < 2.3.4
- Red Hat Red Hat Ansible Automation Platform 2.6 affected
- Red Hat Red Hat OpenShift Container Platform 4 affected

## Identifiers

- CVE-2026-41140
- GHSA-73h3-mf4w-8647
- PYSEC-2026-2890

## Timeline

- 2026-04-18: advisory: Original GitHub security advisory published
- 2026-04-24: disclosed: CVE-2026-41140 published to NVD
- 2026-06-09: patched: Red Hat released updates for Ansible Automation Platform

## References

- [https://github.com/python-poetry/poetry/security/advisories/GHSA-73h3-mf4w-8647](https://github.com/python-poetry/poetry/security/advisories/GHSA-73h3-mf4w-8647)
- [https://access.redhat.com/errata/RHSA-2026:24866](https://access.redhat.com/errata/RHSA-2026:24866)
- [https://access.redhat.com/security/cve/CVE-2026-41140](https://access.redhat.com/security/cve/CVE-2026-41140)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2461604](https://bugzilla.redhat.com/show_bug.cgi?id=2461604)
- [https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41140.json](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41140.json)

## Related threats

- [python-poetry Poetry path traversal in wheel installer](https://junglewise.ai/threats/cve-2026-34591-python-poetry-poetry-path-traversal-in-wheel-installer)
- [Poetry vulnerable to Untrusted Search Path leading to Local Code Execution on Windows](https://junglewise.ai/threats/cve-2022-36070-poetry-vulnerable-to-untrusted-search-path-leading-to-local-code)
- [Poetry Argument Injection can lead to Local Code Execution](https://junglewise.ai/threats/cve-2022-36069-poetry-argument-injection-can-lead-to-local-code-execution)
- [Poetry before v1.1.9 contains Untrusted Search Path](https://junglewise.ai/threats/cve-2022-26184-poetry-before-v1-1-9-contains-untrusted-search-path)
