Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-102938— virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection

Quick assessment

Affected
pypa virtualenv
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

virtualenv 是一款用于创建隔离的 Python 虚拟环境的工具。在 21.7.11 版本之前,PyEnvCfg.write() 方法会将 prompt 值原样写入行导向的 pyvenv.cfg 文件格式中,而 PyEnvCfg._read_values() 方法使用 str.splitlines() 解析该文件,并对重复键取最后一个值。如果攻击者能够影响 --prompt 参数、VIRTUALENV_PROMPT 环境变量或配置输入,则可以插入一个被识别为有效行的换行符以及额外的键值对(例如 home 键

CVSS 5.8 · Medium EPSS 0.15% · P5

Possible ATT&CK Techniques 1 AI

T1059 · Command and Scripting Interpreter

Affected Version Matrix 1

VendorProduct Version RangeStatus
pypa virtualenv < 21.7.11 affected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-102938

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection
Source: CVE Program / CVE List V5
Vulnerability Description
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.11, PyEnvCfg.write() writes prompt values verbatim to the line-oriented pyvenv.cfg format while PyEnvCfg._read_values() parses the file with str.splitlines() and accepts the last value for duplicate keys. An attacker who influences --prompt, VIRTUALENV_PROMPT, or configuration input can insert a recognized line boundary and additional keys, including home, causing consumers to use an attacker-selected base interpreter or corrupted environment metadata. The security impact requires prompt input from outside the operator's trust boundary; directly supplied prompt content primarily corrupts the operator's own environment. This issue is fixed in version 21.7.11.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
Source: CVE Program / CVE List V5
Vulnerability Type
对CRLF序列的转义处理不恰当(CRLF注入)
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
pypa virtualenv < 21.7.11 -

II. Public POCs for CVE-2026-102938

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-102938

请登录查看更多情报信息。

Patches & Fixes for CVE-2026-102938 (2)

Other References for CVE-2026-102938 (2)

Same Patch Batch · pypa · 2026-09-29 · 4 CVEs total

CVE-2026-102925 7.8 HIGH virtualenv bash and fish activation scripts execute commands embedded in paths
CVE-2026-102930 7.7 HIGH virtualenv: Downloaded seed wheels (pip/setuptools) are not integrity-checked before use
CVE-2026-102937 7.3 HIGH virtualenv: Command injection via --prompt in activate.bat (batch activator)

IV. Related Vulnerabilities