Skip to content

CVE-2024-9287 Virtual environment (venv) activation scripts don't quote paths

MediumCVSS 5.3 EPSS 0.65%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: total
Technology
UbuntuDebian

Description

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.

Upgrade path

17 packages: 17 fixed.

PackageAffectedFixed inStatus
alpine/python3(Alpine v3.18) < 3.11.11-r0 3.11.11-r0 Fixed
alpine/python3(Alpine v3.19) < 3.11.11-r0 3.11.11-r0 Fixed
alpine/python3(Alpine v3.20) < 3.12.8-r0 3.12.8-r0 Fixed
alpine/python3(Alpine v3.21) < 3.12.8-r0 3.12.8-r0 Fixed
alpine/python3(Alpine v3.22) < 3.12.8-r0 3.12.8-r0 Fixed
alpine/python3(Alpine v3.23) < 3.12.8-r0 3.12.8-r0 Fixed
alpine/python3(Alpine v3.24) < 3.12.8-r0 3.12.8-r0 Fixed
debian/pypy3(Debian 12) < 7.3.11+dfsg-2+deb12u3; = 7.3.11+dfsg-2; = 7.3.11+dfsg-2+deb12u1; = 7.3.11+dfsg-2+deb12u2 7.3.11+dfsg-2+deb12u3 Fixed
debian/pypy3(Debian 13) < 7.3.17+dfsg-3 7.3.17+dfsg-3 Fixed
debian/pypy3(Debian 14) < 7.3.17+dfsg-3 7.3.17+dfsg-3 Fixed
debian/python3.11(Debian 12) < 3.11.2-6+deb12u5; = 3.11.2-6; = 3.11.2-6+deb12u1; = 3.11.2-6+deb12u2 +2 more 3.11.2-6+deb12u5 Fixed
debian/python3.13(Debian 13) < 3.13.1-1 3.13.1-1 Fixed
python < 3.9.21; = 3.14.0-alpha1; >= 3.10.0, < 3.10.16; >= 3.11.0, < 3.11.11 +2 more 3.9.21, 3.10.16, 3.11.11, 3.12.8, 3.13.1 Fixed
Python Software Foundation CPython < 3.9.21; >= 3.10.0, < 3.10.16; >= 3.11.0, < 3.11.11; >= 3.12.0, < 3.12.8 +2 more 3.9.21, 3.10.16, 3.11.11, 3.12.8, 3.13.1, 3.14.0a2 Fixed
ubuntu/python3.10(Ubuntu 22.04) < 3.10.12-1~22.04.7 3.10.12-1~22.04.7 Fixed
ubuntu/python3.11(Ubuntu 22.04) < 3.11.0~rc1-1~22.04.1~esm2 3.11.0~rc1-1~22.04.1~esm2 Fixed
ubuntu/python3.12(Ubuntu 24.04) < 3.12.3-1ubuntu0.3 3.12.3-1ubuntu0.3 Fixed

Affected products

ProductAffected versionsFixed in
debian/pypy3(Debian:12) < 7.3.11+dfsg-2+deb12u3 7.3.11+dfsg-2+deb12u3
debian/pypy3(Debian:12) = 7.3.11+dfsg-2 No fix listed
debian/pypy3(Debian:12) = 7.3.11+dfsg-2+deb12u1 No fix listed
debian/pypy3(Debian:12) = 7.3.11+dfsg-2+deb12u2 No fix listed
debian/pypy3(Debian:13) < 7.3.17+dfsg-3 7.3.17+dfsg-3
debian/pypy3(Debian:14) < 7.3.17+dfsg-3 7.3.17+dfsg-3
debian/python3.11(Debian:12) < 3.11.2-6+deb12u5 3.11.2-6+deb12u5
debian/python3.11(Debian:12) = 3.11.2-6 No fix listed
debian/python3.11(Debian:12) = 3.11.2-6+deb12u1 No fix listed
debian/python3.11(Debian:12) = 3.11.2-6+deb12u2 No fix listed
debian/python3.11(Debian:12) = 3.11.2-6+deb12u3 No fix listed
debian/python3.11(Debian:12) = 3.11.2-6+deb12u4 No fix listed
debian/python3.13(Debian:13) < 3.13.1-1 3.13.1-1
ubuntu/python3.10(Ubuntu:22.04) < 3.10.12-1~22.04.7 3.10.12-1~22.04.7
ubuntu/python3.11(Ubuntu:22.04) < 3.11.0~rc1-1~22.04.1~esm2 3.11.0~rc1-1~22.04.1~esm2
Python Software Foundation CPython < 3.9.21 3.9.21
Python Software Foundation CPython >= 3.10.0, < 3.10.16 3.10.16
Python Software Foundation CPython >= 3.11.0, < 3.11.11 3.11.11
Python Software Foundation CPython >= 3.12.0, < 3.12.8 3.12.8
Python Software Foundation CPython >= 3.13.0, < 3.13.1 3.13.1
Python Software Foundation CPython >= 3.14.0a1, < 3.14.0a2 3.14.0a2
alpine/python3(Alpine:v3.18) < 3.11.11-r0 3.11.11-r0
alpine/python3(Alpine:v3.19) < 3.11.11-r0 3.11.11-r0
alpine/python3(Alpine:v3.20) < 3.12.8-r0 3.12.8-r0
alpine/python3(Alpine:v3.21) < 3.12.8-r0 3.12.8-r0
Show 10 more
ProductAffected versionsFixed in
alpine/python3(Alpine:v3.22) < 3.12.8-r0 3.12.8-r0
alpine/python3(Alpine:v3.23) < 3.12.8-r0 3.12.8-r0
alpine/python3(Alpine:v3.24) < 3.12.8-r0 3.12.8-r0
ubuntu/python3.12(Ubuntu:24.04) < 3.12.3-1ubuntu0.3 3.12.3-1ubuntu0.3
python < 3.9.21 3.9.21
python >= 3.10.0, < 3.10.16 3.10.16
python >= 3.11.0, < 3.11.11 3.11.11
python >= 3.12.0, < 3.12.8 3.12.8
python >= 3.13.0, < 3.13.1 3.13.1
python = 3.14.0-alpha1 No fix listed

References