# CVE-2013-1629: Improper Input Validation in pip

> Man-in-the-middle attackers can execute arbitrary code by intercepting unverified HTTP package downloads during pip install operations.

- **Severity:** Medium 6.8 (`AV:N/AC:M/Au:N/C:P/I:P/A:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Aug 2013
- **Updated:** 16 Sep 2024
- **Also known as:** DEBIAN-CVE-2013-1629, GHSA-g3p5-fjj9-h8gj, PYSEC-2013-8

## What is CVE-2013-1629?

CVE-2013-1629 is a medium-severity vulnerability in n/a, published on 6 Aug 2013. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

pip before 1.3 uses HTTP to retrieve packages from the PyPI repository, and does not perform integrity checks on package contents, which allows man-in-the-middle attackers to execute arbitrary code via a crafted response to a "pip install" operation.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2013-1629?

3 open source packages ship an affected version, including pip. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pip` | PyPI | All versions | 1.3 |
| `pip` | PyPI | All versions | 1.3 |
| `pip` | PyPI | All versions | 1.3 |

Products: Pypa Pip.

## How do I fix CVE-2013-1629?

Upgrade pip to 1.3 or later.

## Is CVE-2013-1629 being exploited?

There is no known exploitation of CVE-2013-1629 in the wild and no public exploit code.

## Other vulnerabilities in n/a

- [CVE-2018-20225](https://insights.sbomify.com/CVE-2018-20225/): Supply chain in n/a (high 7.8)
- [CVE-2026-13346](https://insights.sbomify.com/CVE-2026-13346/): pip absolute path traversal during download from malicious package indexes (medium 5.6)
- [CVE-2023-5752](https://insights.sbomify.com/CVE-2023-5752/): Mercurial configuration injectable in repo revision when installing via pip (medium 5.5)
- [CVE-2026-8643](https://insights.sbomify.com/CVE-2026-8643/): pip can extract console_scripts and gui_scripts outside installation directory (medium 4.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2013-1629 and fix it if it is affected.

What it is: CVE-2013-1629 is a medium-severity vulnerability in n/a, published on 6 Aug 2013. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2013-1629 in the wild and no public exploit code.

Affected packages and fixed versions:
- pip (PyPI): affected all versions; fixed in 1.3
- pip (PyPI): affected all versions; fixed in 1.3
- pip (PyPI): affected all versions; fixed in 1.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2013-1629/ (Markdown: https://insights.sbomify.com/CVE-2013-1629/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2013-1629
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2013-1629
- OSV: https://osv.dev/vulnerability/CVE-2013-1629

---
From sbomify Insights: https://insights.sbomify.com/CVE-2013-1629/
Summaries are generated and may contain mistakes; the official description above is the record.
