# Risk map — pypa/pip

> Canonical page: https://codevetter.com/unpack/pip/risk-map

# Risk map — pypa/pip

Scanned commit a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6 (2026-09-23). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

These are source observations and one explicitly labeled failure hypothesis, not confirmed vulnerabilities. Sensitive boundaries include TLS policy, credential retrieval, subprocess execution, and installation outside the checkout. Existing containment checks and hash checks are meaningful protections, but their scope must be preserved. Build-dependency policy and per-package mutation deserve particular attention because they differ from assumptions users may make about the parent install.
- Trusted-host adapters intentionally call certificate verification with verify=False and may cache those responses; ordinary HTTPS uses the secure adapter. Changes to host matching or adapter mounting affect transport trust and cache contents. — [src/pip/_internal/network/session.py#L284-L303](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/network/session.py#L284-L303) [src/pip/_internal/network/session.py#L366-L400](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/network/session.py#L366-L400)
- Authentication retrieves URL/index credentials and netrc data, strips credentials from request URLs, and adds Basic Auth; 401 handling can recover redirected URL credentials, consult keyring, prompt, and resend the request. — [src/pip/_internal/network/auth.py#L355-L408](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/network/auth.py#L355-L408) [src/pip/_internal/network/auth.py#L460-L473](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/network/auth.py#L460-L473) [src/pip/_internal/network/auth.py#L499-L559](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/network/auth.py#L499-L559)
- config edit executes a shell command built from --editor, VISUAL, or EDITOR and a quoted configuration filename; the implementation rejects filenames containing a double quote but deliberately retains shell semantics for the editor command. — [src/pip/_internal/commands/configuration.py#L234-L254](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/configuration.py#L234-L254) [src/pip/_internal/commands/configuration.py#L281-L289](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/commands/configuration.py#L281-L289)
- Wheel installation writes into purelib/platlib and scheme-specific destinations, enforcing archive-path containment and entry-point-name containment before writing files or generating launchers. — [src/pip/_internal/operations/install/wheel.py#L468-L473](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/operations/install/wheel.py#L468-L473) [src/pip/_internal/operations/install/wheel.py#L495-L546](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/operations/install/wheel.py#L495-L546) [src/pip/_internal/operations/install/wheel.py#L403-L438](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/operations/install/wheel.py#L403-L438) [src/pip/_internal/operations/install/wheel.py#L602-L612](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/operations/install/wheel.py#L602-L612)
- Hash-required preparation rejects VCS URLs, existing directories, and unpinned nondirect requirements, and disables metadata-only fetching; cached built wheels are accepted against recorded source hashes rather than wheel hashes. — [src/pip/_internal/operations/prepare.py#L433-L478](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/operations/prepare.py#L433-L478) [src/pip/_internal/operations/prepare.py#L675-L700](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/operations/prepare.py#L675-L700)
- InprocessBuildEnvironmentInstaller hard-codes require_hashes=False and records that build-dependency hash checking is deferred; it also documents imperfect interaction with venv-based build environments. — [src/pip/_internal/build_env/installer.py#L155-L171](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/build_env/installer.py#L155-L171) [src/pip/_internal/build_env/installer.py#L189-L210](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/build_env/installer.py#L189-L210)
- Build metadata invokes configured project backend hooks, and VCS operations execute external commands; call_subprocess() copies the process environment, applies explicit additions/removals, and launches arguments through Popen. — [src/pip/_internal/req/req_install.py#L492-L540](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/req/req_install.py#L492-L540) [src/pip/_internal/vcs/versioncontrol.py#L635-L649](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/vcs/versioncontrol.py#L635-L649) [src/pip/_internal/utils/subprocess.py#L123-L139](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/utils/subprocess.py#L123-L139)
- Failure hypothesis: an interrupted config save could truncate its INI file, and a later package failure could leave earlier packages changed. Configuration uses direct write mode, while installation rollback is scoped to the current requirement's previous uninstall. (inferred) — [src/pip/_internal/configuration.py#L213-L230](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/configuration.py#L213-L230) [src/pip/_internal/req/__init__.py#L73-L103](https://github.com/pypa/pip/blob/a7002c9771a6c3f0317a4e6b9fbdcd22e643f7b6/src/pip/_internal/req/__init__.py#L73-L103)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
