Junglewise Threat Intelligence

CVE-2026-13346: PyPA pip path traversal via doubly-encoded package URLs

CVE-2026-13346 · Severity: medium · CVSS 4 · Published 2026-07-29

Technologies: pip (PyPI). Vendors: Python Packaging Authority, PyPI.

Executive brief

pip is a package installer for Python. When downloading packages from a package index, pip failed to properly decode specially-crafted URLs with double-encoded path separators, allowing an attacker controlling a malicious package index to place files outside their intended installation directory. This could lead to unauthorized file placement on a user's system, particularly affecting users of the `pip download --only-binary` command.

Technical details

This vulnerability is a path traversal issue (CWE-36) caused by double URL decoding in the Link class. The vulnerable code performed percent-decoding twice: once in Link.__init__() when parsing the URL path, and again in Link.filename when extracting the basename. A doubly-encoded separator like %252F would be decoded to %2F in __init__(), then to / in filename, converting a single path component like a%2Fb.whl into a/b.whl. An attacker controlling a malicious package index can craft package URLs with doubly-encoded separators to bypass path validation and install files to arbitrary locations. The vulnerability requires the victim to download or install from an untrusted index; it is patched in pip 26.2.0 by removing the second decode and treating the filename as a single path component.

Affected products

  • Python Packaging Authority pip < 26.2.0

Timeline

  • 2026-07-29: disclosed
  • 2026-07-01: patched: Fix committed to main branch
  • 2026-09-01: advisory: Reviewed and published to GitHub Advisory Database

References

Related threats