
Key points
- virtualenv versions up to 21.14.1 are vulnerable to CVE-2026-113732.
- The flaw allows code execution via crafted directory names or prompt strings.
- A patch is available in virtualenv version 21.14.2.
The virtualenv package, versions 21.14.1 and earlier, contains a high-severity vulnerability that allows arbitrary code execution. The issue affects systems using the Fish shell. A fix is available in version 21.14.2. Security teams should update their environments to mitigate this risk immediately. The vulnerability was assigned CVE-2026-113732.
In plain English
The bug occurs because virtualenv uses a quoting method designed for POSIX shells when generating Fish shell activation scripts. Fish shell interprets backslashes inside single quotes differently than POSIX shells do. An attacker can craft a string with backslashes and quotes that breaks out of the intended literal value. This allows the shell to execute commands that follow the crafted string.
The background
The vulnerability exists in the FishActivator component, which inherits quoting logic from ViaTemplateActivator. This logic uses shlex.quote, which does not account for Fish shell parsing rules. If an environment path or prompt variable contains a backslash before a quote, the shell expands subsequent command substitutions. This happens when sourcing the activate.fish file.
What changes now
Version 21.14.2 changes how virtualenv escapes backslashes and single quotes in activate.fish. The new logic aligns with how Fish shell reads these characters. This prevents the shell from interpreting crafted strings as executable commands. The fix ensures that prompts and paths are treated as literal text. Previous fixes in 21.7.13 did not resolve this specific issue.
Who needs to act first
Teams should prioritize updating virtualenv on systems where users or automated jobs create environments in Fish shell. Check CI pipelines and developer workstations first. Verify that the new version generates activation scripts correctly before rolling out broadly. Inspect existing activation files for suspicious content. Backup current environments before updating to ensure rollback capability if issues arise.
What to do and how to stay safe: virtualenv
- Update virtualenv to version 21.14.2 or later on all affected systems.
- Avoid creating virtual environments with paths or prompts containing backslashes.
- Inspect activate.fish files for unexpected command substitutions before sourcing them.
- Monitor logs for unauthorized file creation or command execution in Fish shells.
Step-by-step guide: 7 Configuration Errors That Expose Systems to Zero-Day Exploits
General security guidance from the Vuln Post newsroom. It is not confirmed advice from the organisations named in this story.
Frequently asked questions
Which versions of virtualenv are affected by this vulnerability?
All versions up to and including 21.14.1 are affected by CVE-2026-113732.
Is there a patch available for this issue?
Yes, the vulnerability is fixed in virtualenv version 21.14.2.
How can an attacker exploit this vulnerability?
An attacker can influence the environment path or prompt via CI jobs, wrapper tools, or directory names in cloned repositories.



