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

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

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.

Technologies: pip (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-13346 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-13346 being exploited in the wild.
How severe is CVE-2026-13346?
Medium severity, with a CVSS score of 4, published 29 July 2026.
Which products and versions are affected?
pip (PyPI) < 26.2.0, ECOSYSTEM:introduced=0,fixed=26.2, ECOSYSTEM:introduced=0,fixed=26.2.0.
Is there a fix for CVE-2026-13346?
Yes. pip (PyPI): upgrade to 26.2, 26.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-13346 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-13346?
Check whether you run pip (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

  • pip (PyPI): upgrade to 26.2, 26.2.0 or later
    pip install "pip>=26.2.0"

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

Identifiers

  • CVE-2026-13346
  • GHSA-qwm4-qh6w-59xr
  • PYSEC-2026-3721

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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.