/

CVE-2026-113723

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) in virtualenv Prompt

CVE-2026-113723

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Command execution in the user's shell context

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Caller-supplied prompt text in virtualenv can be interpreted as executable syntax in the Bash activation prompt. If an attacker can influence that text and a user later activates the environment and draws the prompt, commands may run with the user's permissions.

Affected context

The issue is in virtualenv's handling of caller-supplied prompt text used by the Bash activation prompt. It becomes a risk when an attacker can influence the prompt value and a user subsequently activates the environment and causes the prompt to be displayed. The description identifies versions before 21.14.9 as affected.

Exploit preconditions

  • Attack surface: Prompt text supplied to virtualenv and used by a Bash activation script
  • Required access: Ability to influence the value passed to virtualenv; the attacker need not necessarily have direct access to the user's shell
  • Trigger point: The user activates the environment and draws the Bash prompt
  • Why exploitation is possible: Caller-supplied text can be interpreted as executable shell syntax when the prompt is rendered

Why this happens

The underlying issue is command injection (CWE-78): externally influenced data is incorporated into a shell-interpreted prompt without adequate separation from executable syntax. As a result, displaying the prompt can cause text intended as data to be interpreted as shell commands.

Potential impact

  • Arbitrary commands may run with the permissions of the user who activates the environment
  • User files or other accessible resources could be modified or exposed
  • The user's shell session could be disrupted or used to affect other accessible systems

General mitigation guidance

Defensive patterns include treating caller-supplied prompt text as untrusted data, avoiding shell-interpreted construction where possible, and safely escaping or encoding values before placing them in prompts. Prefer secure-by-default APIs that keep data separate from shell syntax, limit who can supply or alter prompt values, and run development tools with only the privileges they need.

How teams detect issues like this

Review code paths that interpolate caller-controlled values into shell activation scripts or prompt definitions. Static analysis and code review can flag shell-sensitive string construction and prompt values that are not safely quoted or escaped. Policy checks can restrict shell evaluation of externally influenced text, and automated review tools may help identify risky patterns.

Sources

SourceLink
github.comgithub.com/pypa/virtualenv/commit/5f48d711731311428aebfae61d46957762155b22
github.comgithub.com/pypa/virtualenv/pull/3418
github.comgithub.com/pypa/virtualenv/releases/tag/21.14.9
github.comgithub.com/pypa/virtualenv/security/advisories/GHSA-6w3r-xr62-4xcp

Frequently asked

questions

The issue is not triggered merely by reaching a remote service. Exploitation depends on an attacker being able to influence the prompt value and a user later activating the environment and displaying the prompt.

The attacker must be able to affect the value passed to virtualenv. The user must then activate the resulting environment and draw the Bash prompt.

Keep caller-supplied text separate from shell syntax. Use safe construction and escaping, or avoid shell-interpreted prompt generation where possible.

Treat values used in shell scripts and prompts as untrusted, review interpolation and quoting carefully, and enforce checks that prevent unsafe shell evaluation.

Find out what's already
exploitable in your codebase.