A vulnerability has been found in the CPython `venv` module and CLI where path names provided when creating a virtual environment were not quoted prop...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| Ubuntu:Pro:14.04:LTSpython3.4 |
< 3.4.3-1ubuntu1~14.04.7+esm14→ 3.4.3-1ubuntu1~14.04.7+esm14 |
3.4.3-1ubuntu1~14.04.7+esm14 |
| Ubuntu:Pro:14.04:LTSpython3.5 |
< 3.5.2-2ubuntu0~16.04.4~14.04.1+esm4→ 3.5.2-2ubuntu0~16.04.4~14.04.1+esm4 |
3.5.2-2ubuntu0~16.04.4~14.04.1+esm4 |
| Ubuntu:Pro:16.04:LTSpython3.5 |
< 3.5.2-2ubuntu0~16.04.13+esm16→ 3.5.2-2ubuntu0~16.04.13+esm16 |
3.5.2-2ubuntu0~16.04.13+esm16 |
| Ubuntu:Pro:18.04:LTSpython3.6 |
< 3.6.9-1~18.04ubuntu1.13+esm3→ 3.6.9-1~18.04ubuntu1.13+esm3 |
3.6.9-1~18.04ubuntu1.13+esm3 |
| Ubuntu:Pro:18.04:LTSpython3.7 |
< 3.7.5-2ubuntu1~18.04.2+esm4→ 3.7.5-2ubuntu1~18.04.2+esm4 |
3.7.5-2ubuntu1~18.04.2+esm4 |
| Ubuntu:Pro:18.04:LTSpython3.8 |
< 3.8.0-3ubuntu1~18.04.2+esm3→ 3.8.0-3ubuntu1~18.04.2+esm3 |
3.8.0-3ubuntu1~18.04.2+esm3 |
| Ubuntu:20.04:LTSpython3.8 |
< 3.8.10-0ubuntu1~20.04.16→ 3.8.10-0ubuntu1~20.04.16 |
3.8.10-0ubuntu1~20.04.16 |
| Ubuntu:Pro:20.04:LTSpython3.9 |
< 3.9.5-3ubuntu0~20.04.1+esm3→ 3.9.5-3ubuntu0~20.04.1+esm3 |
3.9.5-3ubuntu0~20.04.1+esm3 |
| Ubuntu:22.04:LTSpython3.10 |
< 3.10.12-1~22.04.7→ 3.10.12-1~22.04.7 |
3.10.12-1~22.04.7 |
| Ubuntu:Pro:22.04:LTSpython3.11 |
< 3.11.0~rc1-1~22.04.1~esm2→ 3.11.0~rc1-1~22.04.1~esm2 |
3.11.0~rc1-1~22.04.1~esm2 |
| Ubuntu:24.04:LTSpython3.12 |
< 3.12.3-1ubuntu0.3→ 3.12.3-1ubuntu0.3 |
3.12.3-1ubuntu0.3 |
Original description The description as published by the source.
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.
Source: OSV.dev (Open Source Vulnerabilities) OSV
References
- advisory ubuntu.com
- advisory ubuntu.com
- advisory ubuntu.com
- report ubuntu.com
- report cve.org
- report github.com
- report mail.python.org
- report github.com