CVE-2026-113715: virtualenv: line-boundary injection alters pyvenv.cfg
GHSA-qmx5-4p3x-wvqfLOWCISA: TRACK*virtualenv, the Python environment tool underneath much ML tooling, has a low-severity flaw. When it uses the stdlib venv creator, a destination path containing a line-boundary character such as U+2028 can inject extra keys into the environment's pyvenv.cfg. Exposure is narrow. The attacker has to control the destination path, and the non-default `--creator venv` must be in use. EPSS is 0.00142 (reported in the top 97th percentile), there is no public exploit, no Nuclei template, and it is not in CISA KEV. The package has about 6,390 downstream dependents, so it is widely deployed even though few setups are exposed. Upgrade to virtualenv 21.14.9 and reject line-boundary characters in any externally supplied environment path, for example in CI, notebook platforms or agent sandboxes that create environments from user input.
What is the risk?
Low. Exploitation needs an untrusted party to influence the venv destination path, and the stdlib venv creator must be chosen explicitly or through a rare fallback. The default builtin creator is not affected. The injected `home` value only matters if the attacker also controls that location, and `include-system-site-packages = true` weakens isolation. No public exploit or Nuclei template exists, and the maintainers rate it low. EPSS is low in absolute terms (0.00142) even though the percentile is high. Confidence: HIGH, based on the advisory text.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Anthropic Python | pip | < 21.14.9 | 21.14.9 |
Do you use Anthropic Python? You're affected.
How severe is it?
What should I do?
1 step1) Upgrade virtualenv to 21.14.9 or later (all versions below 21.14.9 are affected per the advisory; earlier releases were not individually tested). 2) Until patched, reject line-boundary characters (U+2028, U+2029, \n, \r, \x0b, \x0c, \x1c-\x1e, \x85) in any externally supplied destination path. 3) Prefer the builtin creator where supported and avoid
--creator venvwith untrusted paths. 4) Detection: scan generated pyvenv.cfg files for unexpectedhomeorinclude-system-site-packageslines, and audit automation that builds environments from user, tenant or repository-supplied names. 5) Inventory withpip listor SBOM tooling to find virtualenv in CI images and build tooling.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-113715?
virtualenv, the Python environment tool underneath much ML tooling, has a low-severity flaw. When it uses the stdlib venv creator, a destination path containing a line-boundary character such as U+2028 can inject extra keys into the environment's pyvenv.cfg. Exposure is narrow. The attacker has to control the destination path, and the non-default `--creator venv` must be in use. EPSS is 0.00142 (reported in the top 97th percentile), there is no public exploit, no Nuclei template, and it is not in CISA KEV. The package has about 6,390 downstream dependents, so it is widely deployed even though few setups are exposed. Upgrade to virtualenv 21.14.9 and reject line-boundary characters in any externally supplied environment path, for example in CI, notebook platforms or agent sandboxes that create environments from user input.
Is CVE-2026-113715 actively exploited?
No confirmed active exploitation of CVE-2026-113715 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-113715?
1) Upgrade virtualenv to 21.14.9 or later (all versions below 21.14.9 are affected per the advisory; earlier releases were not individually tested). 2) Until patched, reject line-boundary characters (U+2028, U+2029, \n, \r, \x0b, \x0c, \x1c-\x1e, \x85) in any externally supplied destination path. 3) Prefer the builtin creator where supported and avoid `--creator venv` with untrusted paths. 4) Detection: scan generated pyvenv.cfg files for unexpected `home` or `include-system-site-packages` lines, and audit automation that builds environments from user, tenant or repository-supplied names. 5) Inventory with `pip list` or SBOM tooling to find virtualenv in CI images and build tooling.
What systems are affected by CVE-2026-113715?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, agent frameworks, notebook and sandbox platforms, CI/CD build environments, model serving build pipelines.
What is the CVSS score for CVE-2026-113715?
No CVSS score has been assigned yet.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001AI SoftwareCompliance Controls Affected
What are the technical details?
Original Advisory
## Summary The venv creator reads the standard library's generated pyvenv.cfg with splitlines() and merges all resulting keys over virtualenv's configuration. Line-boundary characters from destination data can therefore become configuration structure before output sanitization. Anthropic's OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026. ## Affected area Configuration readback by the stdlib venv creator. ## Attacker-controlled input An untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a character that Python treats as a line boundary. The builtin creator follows a different configuration-writing path. ## Affected code The relevant 21.14.8 source is in [venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py), [configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py). ## Mechanism With `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with `str.splitlines()`, and merges the parsed keys over virtualenv's chosen settings. CPython writes the destination into a `command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination containing U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback. Virtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path. ## Reproduction and evidence The scanner used one destination value with U+2028 between `home = /attacker/chosen`, `include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the value inside its `command` line and reported the base interpreter's `sys._home`. `virtualenv --creator venv --no-seed` on the same value wrote separate injected configuration lines and its interpreter reported `sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra keys came from virtualenv's readback, not from the standard library's initial file alone. The altered `home` can change which standard-library files the interpreter loads if an attacker also controls that location; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required, either explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in 20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and rebuilds the final configuration from selected settings. ## Attack sequence ```mermaid sequenceDiagram participant A as Destination supplier participant S as stdlib venv participant V as virtualenv readback participant C as Final pyvenv.cfg participant P as Environment Python A->>S: path contains U+2028 and home = /attacker/chosen S->>C: write path inside command value V->>C: read with splitlines() V->>V: parse suffix as separate keys V->>C: rewrite home and include-system-site-packages P->>C: read injected keys on startup C-->>P: sys._home changes and isolation is disabled ``` ## Reproducer files The following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73` in the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs need a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update. **`repro`** ```text #!/usr/bin/env python3 import os import shutil import subprocess work = "/tmp/repro-venv-creator-cfg" shutil.rmtree(work, ignore_errors=True) # the attacker's input: the text of a destination path. # U+2028 ends a line for str.splitlines() but not for CPython's own pyvenv.cfg reader. # The slashes only make nested directories; the last key, x, absorbs the rest of the path. LS = "\u2028" dest = f"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env" base_python = os.path.realpath(shutil.which("python")) real_home = os.path.dirname(base_python) def pyvenv_cfg_lines(env): # split on "\n" only, as the interpreter does return open(f"{env}/pyvenv.cfg", encoding="utf-8").read().split("\n") def sys_home(env): # site.py sets sys._home from the `home` key of the environment's pyvenv.cfg probe = [f"{env}/bin/python", "-c", "import sys; print(sys._home)"] return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip() # control: the same path through the standard library alone stdlib_env = dest + "-stdlib" subprocess.run([base_python, "-m", "venv", "--without-pip", stdlib_env], check=True) # attack: the same path through virtualenv; --creator venv is the one non-default option virtualenv_env = dest + "-virtualenv" created = subprocess.run(["virtualenv", "--quiet", "--no-periodic-update", "--no-seed", "--creator", "venv", virtualenv_env]) if created.returncode != 0: # refusing such a destination is a valid fix print("virtualenv refused the destination") print("OK") raise SystemExit # check stdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env) virtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env) print("CONTROL python -m venv wrote pyvenv.cfg:") for line in stdlib_cfg: print(" " + ascii(line)) print(f"CONTROL python -m venv: sys._home = {stdlib_home}") print("OBSERVED virtualenv --creator venv wrote pyvenv.cfg:") for line in virtualenv_cfg: print(" " + ascii(line)) print(f"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}") keys_injected = "home = /attacker/chosen" in virtualenv_cfg and "include-system-site-packages = true" in virtualenv_cfg print("BUG" if stdlib_home == real_home and keys_injected and virtualenv_home == "/attacker/chosen" else "OK") ``` ## Impact Destination path data can change configuration boundaries and therefore environment settings. The effect depends on which settings change and how the environment is subsequently used. Severity: low. ## Versions tested The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9. The fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved path again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv options, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain supported. Fix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426). ## Known mitigation Reject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported. ## Affected release - [x] The problem reproduces on virtualenv 21.14.8. ## Credits Reported by Anthropic's OSS Scanner as ANT-2026-6ZQHJ6VI.
Exploitation Scenario
A multi-tenant ML notebook or CI platform creates a per-job virtualenv with `--creator venv`, and the directory name comes from a user-controlled project or branch name. The attacker submits a name containing U+2028 followed by `home = /attacker/chosen` and `include-system-site-packages = true`. virtualenv reads the stdlib-written pyvenv.cfg with splitlines(), treats the suffix as separate keys, and writes them out as real configuration lines. If the attacker also controls the chosen home location, the interpreter can load attacker-influenced standard-library files when the environment starts. More realistically, system site-packages leak into the job and isolation between dependencies is weakened.
Weaknesses (CWE)
CWE-93 — Improper Neutralization of CRLF Sequences ('CRLF Injection'): The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.
- [Implementation] Avoid using CRLF as a special sequence.
- [Implementation] Appropriately filter or quote CRLF sequences in user-controlled input.
Source: MITRE CWE corpus.
References
Timeline
Related Vulnerabilities
CVE-2026-9460310.0Podman: checkpoint images override sandbox on run
Same package: anthropicCVE-2026-544498.8LangBot: RCE via arbitrary STDIO MCP command
Same package: anthropicCVE-2026-277758.8Gitea: cached permission check allows repo takeover
Same package: anthropicCVE-2026-554298.7Coder: cross-workspace agent hijack via app ID reuse
Same package: anthropicCVE-2026-75748.7Claude Desktop: VM integrity bypass enables RCE
Same package: anthropic