High (AgentArmorHQ estimate)Command injection

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

  1. Upgrade to the fixed version: run pip install --upgrade "virtualenv>=21.14.13" (first patched version 21.14.13). [1]
  2. Set VIRTUAL_ENV_DISABLE_PROMPT=1 before activating; this skips the whole prompt block. [1]
  3. Activate with promptvars left at its default. [1]
  4. 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.

Discuss this incident

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

  • The advisory says the fix is to escape $ and the backtick for bash in both branches of the prompt code. [1]
  • Version 21.14.13 is the patched release. [1]

Sources

  1. 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.

Brief
[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-virtualenv
Was this page useful?

Corrections

Report an error or request a correction. We review requests within 5 business days and add a dated correction note.

10 to 2,000 characters. A link to a source helps. Stored as plain text.

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.

Check before you install

Paste a package name or a GitHub link and get a clear answer in seconds: Block, Review or No known issues. No account needed.

Check a package

Questions? Contact us