Dev.to Security 🔐 Cybersecurity 👁 0 📖 1 min read

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

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:

  1. Execute 'pip install --upgrade virtualenv>=21.14.9' in the environment build pipeline.
  2. Remove old virtual environment directories using 'rm -rf .venv'.
  3. Re-create virtual environments using the updated virtualenv package.
  4. Verify that bin/activate contains literal variable references for PS1 assignments.

References

Read the full report for CVE-2026-113723 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.