Junglewise Threat Intelligence

CVE-2026-3087: Python shutil path traversal in ZIP extraction on Windows

CVE-2026-3087 · Severity: high · CVSS 7.5 · Published 2026-04-27

Technologies: Python Software Foundation CPython. Vendors: Python Software Foundation.

Executive brief

A vulnerability exists in the Python 'shutil' library, which is commonly used by developers to manage files and archives. When extracting a ZIP file on Windows, a specially crafted archive can place files in arbitrary locations on the computer instead of the intended folder. This could allow an attacker to overwrite sensitive system files or application data, potentially leading to system compromise.

Technical details

A path traversal vulnerability (CWE-22) exists in the `shutil.unpack_archive()` function within Python's standard library. When processing ZIP archives on Windows, the function fails to properly sanitize archive members that contain absolute Windows paths (e.g., starting with 'C:\\'). This allows an attacker to bypass the intended `extract_dir` and write files to arbitrary locations on the host filesystem. The root cause was the internal use of a custom extraction loop that did not leverage the built-in sanitization logic of `ZipFile.extractall()`. The fix involves migrating to `ZipFile.extractall()` to ensure proper path validation.

Affected products

  • Python Software Foundation Python up to 3.14.4, 3.15.0a1-3.15.0a8

Timeline

  • 2026-04-27: disclosed
  • 2026-04-27: patched: Patches committed to CPython repository
  • 2026-04-27: advisory

References