# CVE-2026-6357: pip self-update functionality can import newly installed modules after wheel installation

> Attackers can execute arbitrary code by installing malicious wheels that are imported during pip's self-update check before the update completes.

- **Severity:** Medium 5.3 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 27 Apr 2026
- **Updated:** 27 Apr 2026
- **Also known as:** AZL-85011, AZL-85265, BELL-CVE-2026-6357, CLEANSTART-2026-SE54902, CLEANSTART-2026-ZI04041, DEBIAN-CVE-2026-6357, ECHO-0a2a-4462-0b2a, GHSA-jp4c-xjxw-mgf9, MINI-24m3-7gvf-6572, MINI-4hq9-rm2j-67f4, MINI-4mv4-xw4q-9v7m, MINI-6vpf-gp4x-w56q, MINI-834f-55f7-x32g, MINI-83jr-f9qp-7vm5, MINI-crx3-vx3p-2mfx, MINI-gx8f-ffch-hwf8, MINI-v92g-j3vg-2jfp, PYSEC-2026-2876, ROOT-APP-PYPI-CVE-2026-6357, UBUNTU-CVE-2026-6357

## What is CVE-2026-6357?

CVE-2026-6357 is a medium-severity code injection vulnerability in pip, published on 27 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

pip prior to version 26.1 would run self-update check functionality after installing wheel files which required importing well-known Python modules names. These module imports were intentionally deferred to increase startup time of the pip CLI. The patch changes self-update functionality to run before wheels are installed to prevent newly-installed modules from being imported shortly after the installation of a wheel package. Users should still review package contents prior to installation.

Weakness: CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)

## Which versions are affected by CVE-2026-6357?

3 open source packages ship an affected version, including pip.


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

## How do I fix CVE-2026-6357?

Upgrade pip to 26.1 or later.

## Is CVE-2026-6357 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-6357 and fix it if it is affected.

What it is: CVE-2026-6357 is a medium-severity code injection vulnerability in pip, published on 27 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-6357 in the wild and no public exploit code.

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

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-2026-6357/ (Markdown: https://insights.sbomify.com/CVE-2026-6357/index.md)
```

## Sources

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

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