First published: Thu Oct 24 2024(Updated: )
A vulnerability has been found in the CPython `venv` module and CLI where path names provided when creating a virtual environment were not quoted properly, allowing the creator to inject commands into virtual environment "activation" scripts (ie "source venv/bin/activate"). This means that attacker-controlled virtual environments are able to run commands when the virtual environment is activated. Virtual environments which are not created by an attacker or which aren't activated before being used (ie "./venv/bin/python") are not affected.
Affected Software | Affected Version | How to fix |
---|---|---|
CPython |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
The severity of REDHAT-BUG-2321440 is considered high due to the potential for command injection in virtual environment activation scripts.
To fix REDHAT-BUG-2321440, ensure you upgrade to the patched version of CPython that addresses the quoting issue in the venv module.
REDHAT-BUG-2321440 affects all versions of CPython that utilize the venv module without proper path quoting.
REDHAT-BUG-2321440 can enable attackers to execute arbitrary commands through the manipulation of virtual environment activation scripts.
A temporary workaround for REDHAT-BUG-2321440 involves manually sanitizing and verifying path inputs when creating virtual environments.