CVE-2026-113725: virtualenv Bash Activate Command Injection Vulnerability

virtualenv Updated 21 Oct 2026

Summary

21/10/2026
Yes i
High
7.8

CVE-2026-113725: virtualenv bash activate runs commands from an environment name with a backslash before $. Affects virtualenv versions < 21.14.7. Fixed in 21.14.7. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

virtualenv is a popular Python package that allows users to create isolated Python environments. This isolation helps manage dependencies and versions for different projects without conflicts. However, a vulnerability has been identified in the bash 'activate' script, which can lead to arbitrary command execution if an attacker can influence the environment name.

Vulnerability Detail

The vulnerability arises from the way the bash 'activate' script handles the environment name when modifying the PS1 prompt. It escapes certain characters only during the second pass of prompt drawing, allowing an attacker to execute commands if the environment name contains a backslash followed by a command substitution. This can lead to arbitrary command execution in the user's shell with their privileges each time the prompt is drawn. The issue affects versions prior to 21.14.7, with the potential for serious ramifications if exploited.

How To Fix

Latest published version: 21.14.12 as of 22 Oct 2026

pip install --upgrade "virtualenv==21.14.12"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

21.14.7

This is the first release that contains the fix.

pip install --upgrade "virtualenv==21.14.7"

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

Workaround

As a temporary workaround, you can set the environment variable VIRTUAL_ENV_DISABLE_PROMPT=1 before sourcing the activate script. This will prevent the PS1 prompt from being modified. You can do this by running the following command: 'export VIRTUAL_ENV_DISABLE_PROMPT=1'.

Conclusion

The CVE-2026-113725 vulnerability in virtualenv poses a significant risk due to its potential for arbitrary command execution. Users are strongly encouraged to update to the patched version 21.14.7 or later to mitigate this risk. Additionally, utilizing workarounds can provide temporary relief until an update can be applied.

See every vulnerability recorded for virtualenv →

Share this vulnerability

FAQ

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

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring signup.

If exploited, this vulnerability can lead to arbitrary command execution in the user's shell, potentially allowing an attacker to execute malicious commands with the user's privileges.

Versions of virtualenv prior to 21.14.7 are affected by this vulnerability.

If you cannot update the package immediately, consider using the workaround by setting VIRTUAL_ENV_DISABLE_PROMPT=1 before sourcing the activate script.

Related vulnerabilities

Recent vulnerabilities recorded for virtualenv.

How To Fix

Latest published version: 21.14.12 as of 22 Oct 2026

pip install --upgrade "virtualenv==21.14.12"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

21.14.7

This is the first release that contains the fix.

pip install --upgrade "virtualenv==21.14.7"

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