Command InjectionAffected versions of this package are vulnerable to Command Injection via insufficient escaping of the virtual environment name in the bash activate script (src/virtualenv/activation/bash/activate.sh). Bash processes PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes (e.g. \\ becomes \, \$ becomes $), then expands the result. The activate script escapes the environment name for the expansion pass only, so a backslash in the name undoes that escaping. An attacker who controls the virtual environment name - through the directory name, the --prompt flag, or the VIRTUALENV_PROMPT environment variable - can supply a name such as a\$(touch PWNED), causing arbitrary shell commands to execute each time bash draws the prompt after the environment is activated.
How to fix Command Injection? Upgrade virtualenv to version 21.14.7 or higher.
| |
Command InjectionAffected versions of this package are vulnerable to Command Injection via insufficient escaping of the virtual environment name in the bash activate script (src/virtualenv/activation/bash/activate.sh). Bash processes PS1 in two passes on every prompt redraw: it first decodes backslash prompt escapes (e.g. \\ becomes \, \$ becomes $), then expands the result. The activation script escaped the environment name for the expansion pass only, so a backslash in the name undoes that escaping. An attacker who controls the environment name - through the directory name, --prompt, or VIRTUALENV_PROMPT - can supply a name such as a\$(touch PWNED), causing arbitrary shell commands to execute each time bash draws the prompt after the environment is activated.
How to fix Command Injection? Upgrade virtualenv to version 21.14.7 or higher.
| |