CVE-2026-113715 in virtualenv
Summary
by MITRE • 10/20/2026
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the stdlib venv creator reads generated pyvenv.cfg with str.splitlines() and merges parsed keys over virtualenv's selected configuration. An untrusted caller who influences the destination pathname can include a line-boundary character such as U+2028 to inject keys including home and include-system-site-packages, causing path data to change configuration structure before final output. Setting include-system-site-packages to true weakens environment isolation, while an altered home can change which standard-library files the interpreter loads if the attacker also controls that location. The builtin creator does not use this readback path. This issue is fixed in version 21.14.9.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 10/20/2026
The vulnerability identified within virtualenv prior to version 21.14.9 stems from a flawed configuration parsing mechanism inherent to the standard library venv creator integration. When virtualenv utilizes this internal creator, it generates a pyvenv.cfg file and subsequently reads it back using Python's str.splitlines() method for merging parsed keys with its own selected configuration settings. This readback process is critical because it determines how environment variables are finalized before outputting the final configuration structure to disk. The core technical flaw lies in the behavior of splitlines(), which recognizes a wide variety of Unicode line-boundary characters, including U+2028 (LINE SEPARATOR), as valid delimiters for splitting text into lines. This permissive parsing allows an untrusted caller who influences the destination pathname or environment context to inject these specific non-standard line breaks into the configuration data stream.
By injecting a character such as U+2028, an attacker can effectively split what should be a single configuration key-value pair into multiple logical lines during the readback phase. This manipulation enables the injection of arbitrary keys that virtualenv might process later in its initialization sequence. Specifically, this technique allows for the injection of critical configuration parameters including home and include-system-site-packages. The vulnerability exploits the assumption that the pyvenv.cfg file structure remains predictable and controlled by the tool itself rather than being susceptible to external input manipulation via Unicode line separators. Because the builtin creator does not rely on this specific readback path, it is unaffected, highlighting that the issue is localized to the integration layer with the standard library venv module where configuration merging occurs post-generation.
The operational impact of this vulnerability is significant as it directly compromises the isolation guarantees provided by virtual environments. Setting include-system-site-packages to true via injection weakens environment isolation by allowing code within the virtual environment to access and import modules from the global Python installation. This can lead to dependency conflicts, unexpected behavior due to differing library versions, or potential security issues if malicious packages are present in the system-wide site-packages directory. Furthermore, altering the home parameter changes which standard-library files the interpreter loads during execution. If an attacker also controls the location specified by this altered home path, they could potentially force the interpreter to load modified or malicious standard library modules, leading to arbitrary code execution or privilege escalation depending on the context in which the virtual environment is executed.
This vulnerability aligns with CWE-94 Improper Control of Generation of Code (Code Injection) and specifically relates to CWE-78 Improper Neutralization of Special Elements used in an OS Command if interpreted as part of a broader system configuration attack chain. In terms of MITRE ATT&CK, this behavior can be associated with T1503 Local Application Script Hijacking or techniques related to environment variable manipulation that affect application execution paths. The exploitation requires the ability to influence the destination pathname or initial setup parameters passed to virtualenv, which may occur in automated build systems, CI/CD pipelines, or applications that accept user-supplied project directories for isolation purposes.
To mitigate this risk, organizations should immediately upgrade virtualenv to version 21.14.9 or later where the parsing logic has been corrected to handle line boundaries more strictly and prevent the injection of unintended configuration keys via Unicode separators. For environments unable to update immediately, it is advisable to avoid using the venv creator integration within virtualenv if possible, opting instead for other creation methods that do not rely on this vulnerable readback mechanism. Additionally, validating and sanitizing any user-supplied paths or environment parameters before passing them to isolation tools can reduce the attack surface. Regular auditing of dependency management processes in automated pipelines is also recommended to ensure that third-party tooling updates are applied promptly to address such configuration parsing vulnerabilities.