# Risk map — pypa/hatch

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

# Risk map — pypa/hatch

Scanned commit 7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0 (2026-09-20). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The main sensitive boundaries are executable project configuration, plugin loading, credentials, downloads, and filesystem operations beyond the checkout. These findings describe source behavior and review priorities, not confirmed vulnerabilities. Error handling and persistence choices also affect operational reliability. Tests provide useful signals, but mocks and conditional skips limit what their existence proves.
- Configured scripts are formatted into command strings and EnvironmentInterface.run_shell_command defaults shell=True; pre/post-install commands use this executor, making project command configuration an execution trust boundary. — [src/hatch/env/plugin/interface.py#L963-L1010](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/plugin/interface.py#L963-L1010) [src/hatch/project/core.py#L205-L232](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/project/core.py#L205-L232) [src/hatch/utils/platform.py#L92-L105](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/utils/platform.py#L92-L105)
- Third-party plugin discovery loads installed hatch entry points, custom plugin loaders execute Python modules, and environment plugin requirements may be installed into Hatch's own interpreter through uv or PyApp management. — [backend/src/hatchling/plugin/manager.py#L104-L111](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/plugin/manager.py#L104-L111) [src/hatch/plugin/utils.py#L9-L21](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/plugin/utils.py#L9-L21) [backend/src/hatchling/plugin/utils.py#L13-L23](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/plugin/utils.py#L13-L23) [src/hatch/cli/application.py#L162-L195](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/cli/application.py#L162-L195)
- Authentication can read user configuration, .pypirc, and keyring; config show --all bypasses scrubbing, HATCH_DEBUG enables traceback locals, and upload errors mask the exact authentication string through replacement. — [src/hatch/publish/auth.py#L39-L100](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/publish/auth.py#L39-L100) [src/hatch/cli/config/__init__.py#L25-L34](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/cli/config/__init__.py#L25-L34) [src/hatch/cli/__init__.py#L241-L252](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/cli/__init__.py#L241-L252) [src/hatch/publish/index.py#L124-L128](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/publish/index.py#L124-L128)
- Environment paths may be absolute outside the project and removal deletes both execution/build environments; wheel clean removes every .whl in its selected directory, and force-includes can package external files. — [src/hatch/env/virtual.py#L58-L64](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/virtual.py#L58-L64) [src/hatch/env/virtual.py#L182-L190](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/virtual.py#L182-L190) [backend/src/hatchling/builders/wheel.py#L508-L515](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/builders/wheel.py#L508-L515) [backend/src/hatchling/builders/plugin/interface.py#L218-L245](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/backend/src/hatchling/builders/plugin/interface.py#L218-L245)
- EnvironmentMetadata writes JSON directly with write_text and reads with json.loads, whereas ConfigFile.save uses write_atomic. Hypothesis: interrupted or concurrent metadata writes merit targeted recovery testing; no corruption was observed. (inferred) — [src/hatch/project/env.py#L429-L443](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/project/env.py#L429-L443) [src/hatch/config/user.py#L26-L33](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/config/user.py#L26-L33) [src/hatch/utils/fs.py#L94-L103](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/utils/fs.py#L94-L103)
- IndexPublisher treats any exception during the simple API existence lookup as an empty artifact set, then attempts uploads; this branch is marked no cov and can conceal the original lookup failure. — [src/hatch/publish/index.py#L110-L128](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/publish/index.py#L110-L128)
- PipLocker.apply_lock raises LockerUnsupportedError and install_matches_lock returns False; locked pip environments therefore have a documented synchronization limitation, with a corresponding CLI failure assertion. — [src/hatch/env/lockers/pip.py#L101-L114](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/lockers/pip.py#L101-L114) [src/hatch/env/virtual.py#L249-L266](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/env/virtual.py#L249-L266) [tests/cli/dep/test_dep_lock.py#L161-L168](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/tests/cli/dep/test_dep_lock.py#L161-L168)
- PythonManager.install follows redirects, unpacks downloaded archives, and replaces the interpreter installation; custom distribution sources are supported, and tar extraction explicitly applies filter='data'. This is a remote-content-to-local-executable boundary. — [src/hatch/python/core.py#L81-L119](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/python/core.py#L81-L119) [src/hatch/python/resolve.py#L77-L111](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/python/resolve.py#L77-L111) [src/hatch/utils/network.py#L45-L50](https://github.com/pypa/hatch/blob/7c26ebeaf8b83f5f0374a2545bb15e36c87db0d0/src/hatch/utils/network.py#L45-L50)

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)
