Bug 2321440 (CVE-2024-9287)

Summary: CVE-2024-9287 python: Virtual environment (venv) activation scripts don't quote paths
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: lbalhar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A vulnerability has been found in the Python `venv` module and CLI. Path names provided when creating a virtual environment were not quoted properly, allowing the creator to inject commands into virtual environment "activation" scripts, for example, "source venv/bin/activate". This flaw allows attacker-controlled virtual environments to run commands when the virtual environment is activated.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2321661, 2321653, 2321654, 2321655, 2321656, 2321657, 2321658, 2321659, 2321660, 2321662    
Bug Blocks:    

Description OSIDB Bzimport 2024-10-24 10:14:35 UTC
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.

Comment 1 Lumír Balhar 2024-11-04 06:47:35 UTC
Upstream issue: https://github.com/python/cpython/issues/124651

The fix has already been merged into 3.11+, PRs for 3.10 and 3.9 are waiting and all versions should get a security release after that.

Comment 2 errata-xmlrpc 2024-12-04 08:12:29 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:10779 https://access.redhat.com/errata/RHSA-2024:10779

Comment 3 errata-xmlrpc 2024-12-12 08:38:16 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:10978 https://access.redhat.com/errata/RHSA-2024:10978

Comment 4 errata-xmlrpc 2024-12-12 08:50:21 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:10979 https://access.redhat.com/errata/RHSA-2024:10979

Comment 5 errata-xmlrpc 2024-12-12 08:50:29 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:10980 https://access.redhat.com/errata/RHSA-2024:10980

Comment 6 errata-xmlrpc 2024-12-12 09:15:50 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:10983 https://access.redhat.com/errata/RHSA-2024:10983

Comment 7 errata-xmlrpc 2024-12-12 21:04:10 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.4 Extended Update Support

Via RHSA-2024:11024 https://access.redhat.com/errata/RHSA-2024:11024

Comment 8 errata-xmlrpc 2024-12-13 09:15:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.4 Extended Update Support

Via RHSA-2024:11035 https://access.redhat.com/errata/RHSA-2024:11035

Comment 9 errata-xmlrpc 2024-12-16 12:00:20 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:11111 https://access.redhat.com/errata/RHSA-2024:11111

Comment 10 errata-xmlrpc 2025-01-13 11:35:17 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.4 Extended Update Support

Via RHSA-2025:0280 https://access.redhat.com/errata/RHSA-2025:0280