REDHAT-BUG-2545168: High severity pypi/virtualenv vulnerability

Published Oct 2, 2026
·
Updated

virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.12, BatchActivator.quote() returns prompt text unchanged before activate.bat inserts it into a cmd.exe set "VAR=value" statement. An attacker who influences --prompt, VIRTUALENVPROMPT, or the corresponding configuration value can include a double quote that closes the assignment and leaves following cmd.exe operators as executable syntax. When a user activates the generated Windows environment, the injected commands run with that user's privileges. This issue is fixed in version 21.7.12.

Affected Software

1 affected component
pypi/virtualenv<21.7.12

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade virtualenv to a version that resolves this vulnerability.

    Fixed in 21.7.12

Event History

Oct 2, 2026
Data Sourced
via Red Hat·12:56 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Windows users who activate a virtual environment generated by an affected virtualenv version are exposed when the environment’s prompt can be influenced by an attacker. The injected commands execute with the privileges of the user who runs activate.bat.

2

What attacker-controlled inputs are relevant?

An attacker must be able to influence the --prompt option, the VIRTUALENV_PROMPT environment variable, or the corresponding configuration value. A double quote in the prompt can terminate the intended cmd.exe variable assignment and allow subsequent command operators to be interpreted.

3

How can I determine whether an environment may be affected?

Check whether it was created with a virtualenv version earlier than 21.7.12 and whether its prompt value came from an untrusted or attacker-influenced source. Inspect the generated activate.bat for prompt content embedded in a cmd.exe set "VAR=value" assignment.

4

What should be done if immediate patching is not possible?

Do not activate Windows virtual environments whose prompt settings may be attacker-controlled. Restrict control of --prompt, VIRTUALENV_PROMPT, and the related configuration value to trusted users, and avoid prompt values containing double quotes.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203