Search

Find a vulnerability

Search criteria

    Related vulnerabilities

    BREW-CHARM-TOOLS-CVE-202… (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 08:49 – Updated: 2026-11-19 08:49 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@20.39.1",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "charm-tools",
            "purl": "pkg:brew/charm-tools"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.9.3"
                }
              ],
              "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-charm-tools-CVE-2026-113725",
      "modified": "2026-11-19T08:49:57Z",
      "published": "2026-10-22T08:49:42Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-CONDA-LOCK-CVE-2026… (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:39 – Updated: 2026-11-19 08:45 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.7"
          },
          "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-conda-lock-CVE-2026-113725",
      "modified": "2026-11-19T08:45:29Z",
      "published": "2026-10-29T21:39:28Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "BIT-virtualenv-2026-113725",
        "CVE-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-HATCH-CVE-2026-113725 (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 09:30 – Updated: 2026-11-19 10:09 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.1",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "hatch",
            "purl": "pkg:brew/hatch"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.2.0"
                },
                {
                  "fixed": "1.6.2"
                },
                {
                  "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-hatch-CVE-2026-113725",
      "modified": "2026-11-19T10:09:46Z",
      "published": "2026-10-22T09:30:15Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-NOX-CVE-2026-113725 (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 10:41 – Updated: 2026-11-19 10:29 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "nox",
            "purl": "pkg:brew/nox"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2020.12.31"
                },
                {
                  "fixed": "2022.8.7_1"
                },
                {
                  "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-nox-CVE-2026-113725",
      "modified": "2026-11-19T10:29:00Z",
      "published": "2026-10-22T10:41:11Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-PDM-CVE-2026-113725 (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 09:28 – Updated: 2026-11-19 09:17 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.5",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pdm",
            "purl": "pkg:brew/pdm"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.0.0"
                },
                {
                  "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-pdm-CVE-2026-113725",
      "modified": "2026-11-19T09:17:08Z",
      "published": "2026-10-22T09:28:40Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-PIPENV-CVE-2026-113725 (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 09:47 – Updated: 2026-11-19 09:22 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pipenv",
            "purl": "pkg:brew/pipenv"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "8.3.0"
                },
                {
                  "fixed": "2026.10.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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-pipenv-CVE-2026-113725",
      "modified": "2026-11-19T09:22:30Z",
      "published": "2026-10-22T09:47:00Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-POETRY-CVE-2026-113725 (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-29 22:19 – Updated: 2026-11-19 09:13 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "poetry",
            "purl": "pkg:brew/poetry"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.1.0"
                },
                {
                  "fixed": "1.2.2_1"
                },
                {
                  "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-poetry-CVE-2026-113725",
      "modified": "2026-11-19T09:13:01Z",
      "published": "2026-10-29T22:19:24Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "BIT-virtualenv-2026-113725",
        "CVE-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-PRE-COMMIT-CVE-2026… (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 09:38 – Updated: 2026-11-19 10:22 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pre-commit",
            "purl": "pkg:brew/pre-commit"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "0.5.0"
                },
                {
                  "fixed": "2.20.0_1"
                },
                {
                  "introduced": "3.6.1"
                },
                {
                  "fixed": "4.7.0"
                }
              ],
              "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-pre-commit-CVE-2026-113725",
      "modified": "2026-11-19T10:22:29Z",
      "published": "2026-10-22T09:38:37Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-TOX-CVE-2026-113725 (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 09:02 – Updated: 2026-11-19 09:50 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.8",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "tox",
            "purl": "pkg:brew/tox"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.0.0"
                },
                {
                  "fixed": "4.65.4"
                }
              ],
              "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-tox-CVE-2026-113725",
      "modified": "2026-11-19T09:50:00Z",
      "published": "2026-10-22T09:02:57Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-VIRTUALENVWRAPPER-C… (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 11:13 – Updated: 2026-11-19 10:54 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.7"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "virtualenvwrapper",
            "purl": "pkg:brew/virtualenvwrapper"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "4.8.4"
                },
                {
                  "fixed": "4.8.4_2"
                },
                {
                  "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-virtualenvwrapper-CVE-2026-113725",
      "modified": "2026-11-19T10:54:02Z",
      "published": "2026-10-22T11:13:48Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    BREW-VIRTUALFISH-CVE-202… (GHSA-VXJ4-Q4G9-CRJ7)

    Vulnerability from osv_homebrew – Published: 2026-10-22 09:00 – Updated: 2026-11-19 09:55 – Source website
    VLAI
    Summary
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Details

    Summary

    The bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt.

    Affected area

    src/virtualenv/activation/bash/activate.sh, the block that prepends the environment name to PS1.

    Attacker-controlled input

    The environment name: the environment directory's name, or the --prompt or VIRTUALENV_PROMPT value. An attacker needs to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive. --prompt . takes the current directory's name.

    Details

    bash handles PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning \\ into \ and \$ into $ (or # for root), and then runs parameter expansion, command substitution and arithmetic expansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only for the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before 21.13.0 do not escape the name at all. A bash running as root decodes \$ to #, so the payload shows the wrong text there but runs nothing. zsh does no decode pass and is not affected.

    Proof of concept

    $ virtualenv --prompt 'a\$(touch PWNED)' env
    $ bash --norc --noprofile -c 'source env/bin/activate; printf "%s" "${PS1@P}"'
    $ ls PWNED
    PWNED
    

    Impact

    Arbitrary command execution in the shell of a user who sources the activate script of an environment whose name an attacker influenced, with that user's privileges, once per prompt draw.

    Versions tested

    21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.

    Known mitigation

    Set VIRTUAL_ENV_DISABLE_PROMPT=1 before you source activate, which leaves PS1 alone, or run shopt -u promptvars if your prompt does not need expansion. Check the name of an environment you did not create before you source its activate.

    Latest release

    • [x] The problem reproduces on the latest virtualenv release.

    21.14.6

    Patches

    Fixed in 21.14.7. Under bash, activate now escapes backslashes, dollar signs and backticks for both passes, so the example above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs. Fix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932

    Credits

    Found while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.7"
          },
          "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 bash `activate` script escapes the environment name for only one of the two passes bash makes over `PS1`, so a\nbackslash in the name undoes the escaping and a name containing `\\$(...)` runs as commands in the user\u0027s shell each\ntime bash draws the prompt.\n\n### Affected area\n\n`src/virtualenv/activation/bash/activate.sh`, the block that prepends the environment name to `PS1`.\n\n### Attacker-controlled input\n\nThe environment name: the environment directory\u0027s name, or the `--prompt` or `VIRTUALENV_PROMPT` value. An attacker\nneeds to influence it, for example through a CI job or wrapper tool that passes a branch, project or job name through,\nor a directory in a cloned repository or unpacked archive. `--prompt .` takes the current directory\u0027s name.\n\n### Details\n\nbash handles `PS1` in two passes each time it draws the prompt: it first decodes backslash prompt escapes, turning `\\\\`\ninto `\\` and `\\$` into `$` (or `#` for root), and then runs parameter expansion, command substitution and arithmetic\nexpansion on the result. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in the name, but only\nfor the second pass, so the decode pass strips the escaping that a backslash in the name precedes. Releases before\n21.13.0 do not escape the name at all. A bash running as root decodes `\\$` to `#`, so the payload shows the wrong text\nthere but runs nothing. zsh does no decode pass and is not affected.\n\n### Proof of concept\n\n```console\n$ virtualenv --prompt \u0027a\\$(touch PWNED)\u0027 env\n$ bash --norc --noprofile -c \u0027source env/bin/activate; printf \"%s\" \"${PS1@P}\"\u0027\n$ ls PWNED\nPWNED\n```\n\n### Impact\n\nArbitrary command execution in the shell of a user who sources the `activate` script of an environment whose name an\nattacker influenced, with that user\u0027s privileges, once per prompt draw.\n\n### Versions tested\n\n21.14.6 with bash 5.2.15 on Debian bookworm, as an unprivileged user and as root.\n\n### Known mitigation\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run `shopt -u promptvars`\nif your prompt does not need expansion. Check the name of an environment you did not create before you source its\n`activate`.\n\n### Latest release\n\n- [x] The problem reproduces on the latest virtualenv release.\n\n21.14.6\n\n### Patches\n\nFixed in 21.14.7. Under bash, `activate` now escapes backslashes, dollar signs and backticks for both passes, so the\nexample above runs nothing and the prompt shows the name as given. zsh keeps the single escaping it needs.\nFix: https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932\n\n### Credits\n\nFound while running the virtualenv test suite as root inside the Anthropic OSS Scanner build image.",
      "id": "BREW-virtualfish-CVE-2026-113725",
      "modified": "2026-11-19T09:55:50Z",
      "published": "2026-10-22T09:00:10Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113725"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
          "type": "CVSS_V3"
        }
      ],
      "summary": "virtualenv bash activate runs commands from an environment name with a backslash before $",
      "upstream": [
        "GHSA-vxj4-q4g9-crj7",
        "CVE-2026-113725",
        "BIT-virtualenv-2026-113725",
        "PYSEC-2026-4384"
      ]
    }

    CVE-2026-113725 (GCVE-0-2026-113725)

    Vulnerability from cvelistv5 – Published: 2026-10-20 19:56 – Updated: 2026-10-21 15:52
    VLAI
    Title
    virtualenv bash activate runs commands from an environment name with a backslash before $
    Summary
    virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.7, the bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt. This issue is fixed in version 21.14.7.
    SSVC
    Exploitation: none Automatable: no Technical Impact: total
    CISA Coordinator · CISA-ADP (v2.0.3)
    Decision recorded 2026-10-21 14:39 UTC
    CWE
    • CWE-78 - Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
    • CWE-116 - Improper Encoding or Escaping of Output
    Assigner
    GitHub_M CNA
    Impacted products
    Vendor Product Version
    pypa virtualenv Affected: < 21.14.7
    Create a notification for this product.
    Show details on NVD website

    {
      "containers": {
        "adp": [
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2026-113725",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "total"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2026-10-21T14:39:53.653796Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2026-10-21T15:52:26.038Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "product": "virtualenv",
              "vendor": "pypa",
              "versions": [
                {
                  "status": "affected",
                  "version": "\u003c 21.14.7"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.7, the bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \\$(...) runs as commands in the user\u0027s shell each time bash draws the prompt. This issue is fixed in version 21.14.7."
            }
          ],
          "metrics": [
            {
              "cvssV3_1": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "NONE",
                "scope": "UNCHANGED",
                "userInteraction": "REQUIRED",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
                "version": "3.1"
              }
            }
          ],
          "problemTypes": [
            {
              "descriptions": [
                {
                  "cweId": "CWE-78",
                  "description": "CWE-78: Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)",
                  "lang": "en",
                  "type": "CWE"
                }
              ]
            },
            {
              "descriptions": [
                {
                  "cweId": "CWE-116",
                  "description": "CWE-116: Improper Encoding or Escaping of Output",
                  "lang": "en",
                  "type": "CWE"
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-10-20T19:56:52.195Z",
            "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
            "shortName": "GitHub_M"
          },
          "references": [
            {
              "name": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7",
              "tags": [
                "x_refsource_CONFIRM"
              ],
              "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"
            },
            {
              "name": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"
            },
            {
              "name": "https://github.com/pypa/virtualenv/releases/tag/21.14.7",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.7"
            }
          ],
          "source": {
            "advisory": "GHSA-vxj4-q4g9-crj7",
            "discovery": "UNKNOWN"
          },
          "title": "virtualenv bash activate runs commands from an environment name with a backslash before $"
        }
      },
      "cveMetadata": {
        "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "assignerShortName": "GitHub_M",
        "cveId": "CVE-2026-113725",
        "datePublished": "2026-10-20T19:56:52.195Z",
        "dateReserved": "2026-10-20T16:03:14.863Z",
        "dateUpdated": "2026-10-21T15:52:26.038Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }