Pdm: virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration
Affects pdmSource GCVE Database
Not known to be exploited · CVSS 5.8 Medium : upgrade to 2.29.2_1 or 2.9.3_2 when convenient.
Data as of 31 Oct 2026, 16:53 UTC
- Patch
- Available – fixed in 2.29.2_1, 2.9.3_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
Weaponized: 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 30 Oct 2026.
What to do
Upgrade pdm to 2.29.2_1 or 2.9.3_2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewpdmpkg:brew/pdmOther 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
Apply the official patch by upgrading to pdm versions 2.9.3_2 or 2.29.2_1 or later, where PyEnvCfg.write() sanitizes line boundaries in prompt values. As a workaround, avoid passing externally influenced data as the virtualenv prompt and strip any line boundary characters from prompt values before use. This prevents injection of additional configuration lines into pyvenv.cfg.
Description
A vulnerability in pdm's virtualenv handling allows crafted prompt values containing line boundary characters to inject additional configuration lines into the pyvenv.cfg file. This can cause keys like 'home' to be overwritten, potentially redirecting tooling that relies on this configuration to an attacker-controlled interpreter path. The issue arises because pyvenv.cfg is line-based with no escape syntax, and the write method did not sanitize line boundaries in prompt values. The vulnerability affects pdm versions >=2.0.0 <2.9.3_2 and >=2.12.3 <2.29.2_1 and has been fixed in versions 2.9.3_2 and 2.29.2_1.
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)