Critical Vulnerability in Python 3.x Packages: Command Injection Risk in Virtual Environment Creation

python3.4 Updated 03 Oct 2025

Summary

22/10/2024
N/A
Yes i
High
7.8

UBUNTU-CVE-2024-9287: 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 "... Affects python3.4 versions < 3.4.3-1ubuntu1~14.04.7+esm14. Fixed in 3.4.3-1ubuntu1~14.04.7+esm14. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python is a widely-used high-level programming language known for its readability and versatility. The affected packages, including python3.4, python3.5, python3.6, python3.7, python3.8, python3.9, python3.10, python3.11, and python3.12, are essential for creating and managing virtual environments. These environments allow developers to isolate dependencies for different projects, ensuring that libraries do not conflict. However, a recent vulnerability has been identified in the venv module, which poses a significant risk to users creating virtual environments.

Vulnerability Detail

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. This flaw allows an attacker to inject commands into virtual environment activation scripts, which can lead to unauthorized command execution when the virtual environment is activated. Virtual environments created by an attacker or activated before being used are particularly vulnerable, while those not activated remain unaffected. The CVSS score of this vulnerability is 7.8, indicating a high severity level.

How To Fix

Minimum fixed version

3.4.3-1ubuntu1~14.04.7+esm14

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python3.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid activating virtual environments created by untrusted sources. Instead, use the command './venv/bin/python' to run Python scripts without activating the environment.

Conclusion

The vulnerability in the Python venv module poses a significant risk to users creating virtual environments, allowing for potential command injection. It is crucial to update to the patched versions of the affected packages to mitigate this risk. Users should also be cautious when activating virtual environments from untrusted sources.

See every vulnerability recorded for python3.4 →

Share this vulnerability

FAQ

The vulnerability allows command injection through improperly quoted path names when creating virtual environments.

The vulnerability affects Python versions 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, and 3.12.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The CVSS score of this vulnerability is 7.8, indicating a high severity level.

If you cannot update, avoid using virtual environments created by untrusted sources and consider using the workaround provided.

Related vulnerabilities

Recent vulnerabilities recorded for python3.4.

How To Fix

Minimum fixed version

3.4.3-1ubuntu1~14.04.7+esm14

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python3.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback