CVE-2026-113723: CVE-2026-113723: OS Command Injection via Unsafe Prompt Expansion in PyPA virtualenv
CVE-2026-113723: OS Command Injection via Unsafe Prompt Expansion in PyPA virtualenv Vulnerability ID: CVE-2026-113723 CVSS Score: 7.1 Published: 2026-10-23 A command injection vulnerability in PyPA virtualenv prior
CVE-2026-113723: OS Command Injection via Unsafe Prompt Expansion in PyPA virtualenv
Vulnerability ID: CVE-2026-113723
CVSS Score: 7.1
Published: 2026-10-23
A command injection vulnerability in PyPA virtualenv prior to version 21.14.9 allows local attackers to execute arbitrary commands when a user sources a generated shell activation script containing a crafted prompt value.
TL;DR
Unsafe string replacement in virtualenv bash activation scripts allows arbitrary command execution via crafted prompt names during environment activation.
⚠️ Exploit Status: POC
Technical Details
- CWE ID: CWE-78
- CVSS v4.0 Score: 7.1 (High)
- Attack Vector: Local
- EPSS Score: 0.00142 (3.23th percentile)
- CISA KEV: Not Listed
- Exploit Status: Proof of Concept Available
- Impact: Arbitrary Code Execution
Affected Systems
- PyPA virtualenv prior to version 21.14.9
- Linux, macOS, and Unix systems sourcing Bash/Zsh activation scripts
-
virtualenv: < 21.14.9 (Fixed in:
21.14.9)
Code Analysis
Commit: 5f48d71
Fix PS1 prompt escaping and evaluation logic in bash activation script
Exploit Details
- GitHub Security Advisory: Advisory detailing proof-of-concept command injection via crafted prompt strings.
Mitigation Strategies
- Upgrade virtualenv to version 21.14.9 or higher.
- Regenerate pre-existing virtual environments created with vulnerable virtualenv releases.
- Set VIRTUAL_ENV_DISABLE_PROMPT=1 in shell environments to skip PS1 modifications.
Remediation Steps:
- Execute 'pip install --upgrade virtualenv>=21.14.9' in the environment build pipeline.
- Remove old virtual environment directories using 'rm -rf .venv'.
- Re-create virtual environments using the updated virtualenv package.
- Verify that bin/activate contains literal variable references for PS1 assignments.
References
- GitHub Security Advisory GHSA-6w3r-xr62-4xcp
- Fix Commit 5f48d711731311428aebfae61d46957762155b22
- GitHub Pull Request #3418
- virtualenv Release 21.14.9
- NIST NVD CVE-2026-113723 Record
- CVE Program Record
Read the full report for CVE-2026-113723 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.