Executive brief
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.
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
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://access.redhat.com/errata/RHSA-2026:24866
- https://access.redhat.com/security/cve/CVE-2026-41140
- https://bugzilla.redhat.com/show_bug.cgi?id=2461604
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41140.json