{"vuln_id":"CVE-2026-113722","aliases":["GHSA-c978-59m8-c77v"],"description":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted interpreter path to distlib ScriptMaker when generating POSIX console scripts. When the path contains a space or produces a shebang longer than 127 bytes, distlib emits a /bin/sh wrapper whose double-quoted interpreter path still expands command substitutions and backticks. An attacker who influences the environment destination can therefore execute commands with the user's privileges when the user later runs a generated launcher; environment creation and activation do not trigger the command. Existing launchers are not repaired by upgrading virtualenv alone and must be regenerated, while a later independent pip installation or upgrade can reintroduce an affected launcher because pip's vendored distlib is unchanged. The virtualenv fix is released in version 21.14.9.","published_at":"2026-10-20T20:17:18.810000Z","modified_at":"2026-11-21T19:00:07.496185Z","first_seen_at":"2026-11-21T19:15:47.088427Z","severity":"high","severity_source":"nvd","cvss_score":7.8,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","cwe":["CWE-78"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00261,"epss_percentile":0.18087,"nvd_status":"Analyzed","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-113722"},"matched_alias":null,"items":[{"id":10759,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-c978-59m8-c77v: virtualenv: Generated POSIX console launchers interpret destination paths as shell syntax","summary":"virtualenv: Generated POSIX console launchers interpret destination paths as shell syntax\n\n## Summary\n\nA destination path supplied to virtualenv can be interpreted as shell syntax by a generated POSIX console launcher. The\napp-data seeder and pip delegate launcher generation to distlib but supply the interpreter path in a form that does not\npreserve it as literal data in the shell wrapper.\n\n## Affected area\n\nPOSIX console scripts generated by the app-data seeder or pip when the interpreter path requires a shell wrapper.\nWindows executable launchers are not affected by this path.\n\n## Attacker-controlled input\n\nAn attacker must influence the environment destination passed to virtualenv, and the user must subsequently run a\ngenerated launcher. The attacker does not need to modify an installed executable or control the user's app-data cache.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[ScriptMakerCustom](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/via_app_data/pip_install/base.py).\n\n## Mechanism\n\nThe app-data seeder passes the environment's interpreter path through `enquote_executable()` to distlib's `ScriptMaker`.\nIt adds double quotes for a path with a space but does not escape shell expansions inside those quotes. When the path\nhas a space or the shebang exceeds 127 bytes, distlib emits a `#!/bin/sh` wrapper with a line shaped like\n`'''exec' \"\n\" \"$0\" \"$@\"`. The shell expands `$(...)` and backticks in that path when the launcher is run. The same\nwrapper must also parse as Python, which exposes additional quote and backslash cases. Environment creation and\nactivation do not trigger the shell payload.\n\n## Reproduction and evidence\n\nThe scanner created three environments: a control under `my -touch PWNED- project`, one under\n`my $(touch PWNED) project`, and one under a path of more than 127 bytes ending in `$(touch${IFS}PWNED)`. Each was\ncreated without producing `PWNED`. Running the generated `bin/pip --version` created `PWNED` in both attack cases; the\ncontrol created none. The long-path case reached the shell wrapper without a space. This reproduces execution by the\ngenerated launcher, with the user's privileges, rather than during seeding.\n\nThe report dates the app-data seeder's distlib launcher integration to #1579, first released in 20.0.2.\n[PR #3417](https://github.com/pypa/virtualenv/pull/3417) quotes the raw interpreter path for the POSIX wrapper and\nrepairs launchers written by the pip seeder. Pip's own distlib can write a vulnerable wrapper again during a later pip\ninstall or upgrade; the proposed virtualenv fix does not change pip's vendored code. The maintainer-provided follow-up\nreview reports that later path separately.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\nparticipant A as Destination supplier\nparticipant V as virtualenv seeder\nparticipant D as distlib ScriptMaker\nparticipant S as Generated bin/pip\nparticipant U as User\nA->>V: path contains $(touch PWNED)\nV->>D: pass interpreter path with incomplete shell quotin\n\nAffected: PyPI:virtualenv\n\nFixed in: 21.14.9\n\nReferences:\nhttps://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-113722\nhttps://github.com/pypa/virtualenv/pull/3417\nhttps://github.com/pypa/virtualenv/commit/2519941bed33ee0d3ac99277f67913e439e476a9\nhttps://github.com/pypa/virtualenv\nhttps://github.com/pypa/virtualenv/releases/tag/21.14.9","url":"https://osv.dev/vulnerability/GHSA-c978-59m8-c77v","published_at":"2026-10-21T21:30:12Z","updated_at":"2026-11-18T12:10:51.899471Z","fetched_at":"2026-11-21T19:15:55.946156Z","severity":"high","cvss_score":7.8,"epss":0.00261,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"virtualenv","vuln_id":"CVE-2026-113722","vuln_ids":["CVE-2026-113722","BIT-VIRTUALENV-2026-113722","GHSA-C978-59M8-C77V","PYSEC-2026-4381"],"tags":["osv","pypi","fix-available"],"cluster_id":4107,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10759","html":"https://vulnwatch.ve1ve2.com/item/10759"}},{"id":11336,"source":{"id":"osv","name":"OSV.dev"},"title":"DEBIAN-CVE-2026-113722: virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted in…","summary":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted interpreter path to distlib ScriptMaker when generating POSIX console scripts. When the path contains a space or produces a shebang longer than 127 bytes, distlib emits a /bin/sh wrapper whose double-quoted interpreter path still expands command substitutions and backticks. An attacker who influences the environment destination can therefore execute commands with the user's privileges when the user later runs a generated launcher; environment creation and activation do not trigger the command. Existing launchers are not repaired by upgrading virtualenv alone and must be regenerated, while a later independent pip installation or upgrade can reintroduce an affected launcher because pip's vendored distlib is unchanged. The virtualenv fix is released in version 21.14.9.\n\nAffected: Debian:12:python-virtualenv, Debian:13:python-virtualenv, Debian:14:python-virtualenv\n\nFixed in: 21.15.6+ds-1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2026-113722","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2026-113722","published_at":"2026-10-20T20:17:18.810000Z","updated_at":"2026-11-21T19:00:07.496185Z","fetched_at":"2026-11-21T19:23:21.853711Z","severity":"high","cvss_score":7.8,"epss":0.00261,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"debian","product":"12:python-virtualenv","vuln_id":"CVE-2026-113722","vuln_ids":["CVE-2026-113722","DEBIAN-CVE-2026-113722","GHSA-C978-59M8-C77V"],"tags":["osv","debian","fix-available"],"cluster_id":4106,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11336","html":"https://vulnwatch.ve1ve2.com/item/11336"}},{"id":10760,"source":{"id":"osv","name":"OSV.dev"},"title":"PYSEC-2026-4381: virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted in…","summary":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted interpreter path to distlib ScriptMaker when generating POSIX console scripts. When the path contains a space or produces a shebang longer than 127 bytes, distlib emits a /bin/sh wrapper whose double-quoted interpreter path still expands command substitutions and backticks. An attacker who influences the environment destination can therefore execute commands with the user's privileges when the user later runs a generated launcher; environment creation and activation do not trigger the command. Existing launchers are not repaired by upgrading virtualenv alone and must be regenerated, while a later independent pip installation or upgrade can reintroduce an affected launcher because pip's vendored distlib is unchanged. The virtualenv fix is released in version 21.14.9.\n\nAffected: PyPI:virtualenv\n\nFixed in: 21.14.9\n\nReferences:\nhttps://github.com/pypa/virtualenv/releases/tag/21.14.9\nhttps://github.com/pypa/virtualenv/commit/2519941bed33ee0d3ac99277f67913e439e476a9\nhttps://github.com/pypa/virtualenv/pull/3417\nhttps://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v","url":"https://osv.dev/vulnerability/PYSEC-2026-4381","published_at":"2026-10-20T20:17:18.810000Z","updated_at":"2026-11-18T12:10:51.899471Z","fetched_at":"2026-11-21T19:15:55.946157Z","severity":"high","cvss_score":7.8,"epss":0.00261,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"virtualenv","vuln_id":"CVE-2026-113722","vuln_ids":["CVE-2026-113722","BIT-VIRTUALENV-2026-113722","GHSA-C978-59M8-C77V","PYSEC-2026-4381"],"tags":["osv","pypi","fix-available"],"cluster_id":4106,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10760","html":"https://vulnwatch.ve1ve2.com/item/10760"}},{"id":3766,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-113722: virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted in…","summary":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted interpreter path to distlib ScriptMaker when generating POSIX console scripts. When the path contains a space or produces a shebang longer than 127 bytes, distlib emits a /bin/sh wrapper whose double-quoted interpreter path still expands command substitutions and backticks. An attacker who influences the environment destination can therefore execute commands with the user's privileges when the user later runs a generated launcher; environment creation and activation do not trigger the command. Existing launchers are not repaired by upgrading virtualenv alone and must be regenerated, while a later independent pip installation or upgrade can reintroduce an affected launcher because pip's vendored distlib is unchanged. The virtualenv fix is released in version 21.14.9.\n\nReferences:\nhttps://github.com/pypa/virtualenv/commit/2519941bed33ee0d3ac99277f67913e439e476a9\nhttps://github.com/pypa/virtualenv/pull/3417\nhttps://github.com/pypa/virtualenv/releases/tag/21.14.9\nhttps://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v\nhttps://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113722","published_at":"2026-10-20T20:17:18.810000Z","updated_at":"2026-11-17T17:32:25.300000Z","fetched_at":"2026-11-21T19:15:31.479290Z","severity":"high","cvss_score":7.8,"epss":0.00261,"is_kev":false,"has_exploit":true,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-113722","vuln_ids":["CVE-2026-113722","GHSA-C978-59M8-C77V"],"tags":["CWE-78"],"cluster_id":4106,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/3766","html":"https://vulnwatch.ve1ve2.com/item/3766"}}]}