Hatch: virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration
Affects hatchSource GCVE Database
Not known to be exploited · CVSS 5.8 Medium : upgrade to 1.18.1_1 or 1.6.2 when convenient.
Data as of 27 Oct 2026, 23:27 UTC
- Patch
- Available – fixed in 1.18.1_1, 1.6.2
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 29 Sep 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade hatch to 1.18.1_1 or 1.6.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewhatchpkg:brew/hatchOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in Hatch versions 1.6.2 and 1.18.1_1 that sanitizes line boundary characters in prompt values to prevent injection of additional configuration lines. Users should upgrade to these fixed versions. As a workaround, avoid passing externally influenced data as the virtualenv prompt and strip line boundary characters from any prompt value before use.
Description
A vulnerability in Hatch's virtualenv component allows crafted prompt values containing line boundary characters to inject additional configuration lines into the pyvenv.cfg file. This can lead to the replacement of critical configuration keys such as 'home', which is used by tooling to locate the base interpreter. The issue affects versions >=1.2.0 <1.6.2 and >=1.9.3 <1.18.1_1. A fix is available in versions 1.6.2 and 1.18.1_1 that sanitizes line boundaries in prompt values.
References
- github.com/pypa/virtualenv/security/advisories/GHSA-9h9j-4vrj-gf7g (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-102938 (opens in a new tab)
- github.com/pypa/virtualenv/pull/3247 (opens in a new tab)
- github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140 (opens in a new tab)
- github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4012.yaml (opens in a new tab)
- github.com/pypa/virtualenv (opens in a new tab)
- github.com/pypa/virtualenv/releases/tag/21.7.11 (opens in a new tab)
- pypi.org/project/virtualenv (opens in a new tab)