virtualenv: bash activator leaves --prompt value unescaped in PS1, allowing command execution
- Product
- virtualenv
- CVE
- CVE-2026-115586
- Affected
- virtualenv 21.14.9 to 21.14.12
- Fixed in
- 21.14.13
Last verified against sources: October 26, 2026
Am I affected?
virtualenv: affected virtualenv 21.14.9 to 21.14.12. Fixed in 21.14.13.
- Check your version: run
pip show virtualenv. Versions >= 21.14.9, < 21.14.13 of virtualenv are affected. [1]
What to do now
- Upgrade to the fixed version: run
pip install --upgrade "virtualenv>=21.14.13"(first patched version 21.14.13). [1] - Set VIRTUAL_ENV_DISABLE_PROMPT=1 before activating; this skips the whole prompt block. [1]
- Activate with promptvars left at its default. [1]
- Do not pass an untrusted value to --prompt. [1]
General practice, not from the source: if the affected software could read tokens or credentials, rotate them after upgrading; pin versions and review changes before updating tools your agents run.
What happened
- In virtualenv, the bash activation script copies the --prompt value into the shell prompt variable PS1 without escaping it when the shell option promptvars is off. [1]
- This is a regression: version 21.14.8 escaped the $ and backtick characters, and the 21.14.9 change removed that escaping. [1]
- The prompt value is written into bin/activate and into pyvenv.cfg, so it stays there after the environment is created. [1]
Impact
- An attacker who controls the prompt value can run commands as the user who sources bin/activate. [1]
- The command runs later, at the next prompt redraw, after prompt expansion is turned back on in the same shell or in an interactive child bash. [1]
- The attacker gets no more rights than the user who activates the environment. [1]
What was done
Sources
- GHSA-cx6f-vjhg-g3cc — GitHub Advisory Database
Every statement above was checked against these sources before publishing. Spotted an error? Tell us and we will correct it with a dated note.
Share advisory brief with your team
Copy a plain-text summary for Slack, GitHub issues, or team security channels.
[CVE-2026-115586] virtualenv: bash activator leaves --prompt value unescaped in PS1, allowing command execution
Product: virtualenv | Affected: virtualenv 21.14.9 to 21.14.12 | Fixed in: 21.14.13
Summary: In virtualenv, the bash activation script copies the --prompt value into the shell prompt variable PS1 without escaping it when the shell option promptvars is off.
Source & remediation on AgentArmorHQ: https://agentarmorhq.com/incidents/2026/10/cve-2026-115586-virtualenvCorrections
Report an error or request a correction. We review requests within 5 business days and add a dated correction note.
Discussions for CVE-2026-115586
Ask questions or share configuration tips. Governed by our Community Rules & Terms.
No posts match this filter yet.
Be the first to ask a question or share a working tip.