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

Source: https://junglewise.ai/threats/cve-2026-13346-pypa-pip-path-traversal-via-doubly-encoded-package-urls  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-29. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/pip). Vendors: [PyPI](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/pypa/pip/pull/14110](https://github.com/pypa/pip/pull/14110)
- [https://mail.python.org/archives/list/security-announce@python.org/thread/L2BNQGGVQCEV7DROOORQ7WFKKFF2OOQX](https://mail.python.org/archives/list/security-announce@python.org/thread/L2BNQGGVQCEV7DROOORQ7WFKKFF2OOQX)
- [http://www.openwall.com/lists/oss-security/2026/07/29/7](http://www.openwall.com/lists/oss-security/2026/07/29/7)
- [https://github.com/pypa/pip/commit/10dfb6b9005484578b386f64b9f36982e3dc6679](https://github.com/pypa/pip/commit/10dfb6b9005484578b386f64b9f36982e3dc6679)
- [https://github.com/pypa/advisory-database/tree/main/vulns/pip/PYSEC-2026-3721.yaml](https://github.com/pypa/advisory-database/tree/main/vulns/pip/PYSEC-2026-3721.yaml)

## Related threats

- [PYSEC-2026-2876 - pip Vulnerable to Inclusion of Functionality from Untrusted Control Sphere](https://junglewise.ai/threats/cve-2026-6357-pip-vulnerable-to-inclusion-of-functionality-from-untrusted)
- [PYSEC-2026-1796 - pip Path Traversal vulnerability](https://junglewise.ai/threats/cve-2026-1703-pip-path-traversal-vulnerability)
- [PYSEC-2026-1795 - pip's fallback tar extraction doesn't check symbolic links point to extraction directory](https://junglewise.ai/threats/cve-2025-8869-pip-s-fallback-tar-extraction-doesn-t-check-symbolic-links-point)
- [Python pip path traversal via entry point scripts](https://junglewise.ai/threats/cve-2026-8643-python-pip-path-traversal-via-entry-point-scripts)
- [PyPA pip interpretation conflict in concatenated archive handling](https://junglewise.ai/threats/cve-2026-3219-pypa-pip-interpretation-conflict-in-concatenated-archive-handling)
