virtualenv is vulnerable to OS Command Injection
78
CVE Score
High
OS Command Injection
The generated bash activate script and activate.fish script interpolate a shlex.quote-ed path into a position that is quoted a second time, so the extra quotes terminate early and leave part of the value parsed as shell code. In activate, this triggers on the branch that reports a relocated virtual environment, so a virtual environment path containing $(...), backticks, or ; runs commands when a user sources the script. In activate.fish, the same double quoting around the TCL_LIBRARY and TK_LIBRARY paths lets a parenthesized command substitution in the interpreter's library path execute on source. The fix moves the placeholders outside the surrounding quotes so each value keeps only its original shlex.quote quoting.
Upgrade the virtualenv library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you source a bash or fish activate script for a virtual environment whose path, or whose interpreter's Tcl/Tk library path, can contain untrusted shell metacharacters.
0.8.0 - 21.7.12
Fixed in 21.7.13virtualenv is vulnerable to OS Command Injection in versions 0.8.0 - 21.7.12.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.