Command Injection Affecting virtualenv package, versions [,20.26.6)
Threat Intelligence
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-PYTHON-VIRTUALENV-8136228
- published 1 Oct 2024
- disclosed 1 Oct 2024
- credit y5c4l3
How to fix?
Upgrade virtualenv
to version 20.26.6 or higher.
Overview
Affected versions of this package are vulnerable to Command Injection due to improperly quoted string placeholders in activation scripts through the ViaTemplateActivator
class. The vulnerable functions include various shell activation scripts where placeholders like __VIRTUAL_ENV__
are used.
Note:
This vulnerability is specific to environments where shell scripts are used for virtual environment activation.
Exploiting this vulnerability depends on the ability of the attacker to control the input to these placeholders, therefore it's unlikely to be exploited.
PoC
envname="';uname -a;':"
mkdir "$envname"
cd "$envname"
virtualenv .
. ./bin/activate