{"schema":"threatline.record/2","record":{"id":"CVE-2026-102925","aliases":["BIT-virtualenv-2026-102925","GHSA-p58f-9548-mpm2","PYSEC-2026-4013"],"summary":"virtualenv bash and fish activation scripts execute commands embedded in paths","details":"### Impact\n\nThe generated `activate` (bash/zsh) and `activate.fish` scripts interpolate a `shlex.quote`-ed value into a position that quotes it a second time. The extra quotes terminate the quoted run early and leave part of the value parsed as shell code, so a path containing shell metacharacters runs commands when a user sources the activation script.\n\n`activate` is affected through the virtual environment's own path, on the branch that reports a relocated environment:\n\n```sh\necho \"Virtual environment directory __VIRTUAL_ENV__ does not exist!\" >&2\n```\n\nFor a destination named `x'$(id)'y`, `shlex.quote` emits `'x'\"'\"'$(id)'\"'\"'y'`. The inner `\"` closes the enclosing double quote and `$(id)` is left unquoted. Backtick and `;` payloads reach the same result. This branch runs whenever the recorded path is absent, which is the normal case for a virtual environment copied or distributed to another machine.\n\n`activate.fish` is affected through the interpreter's Tcl/Tk library paths:\n\n```fish\nset -gx TCL_LIBRARY '__TCL_LIBRARY__'\n```\n\n`shlex.quote` already returns `'/tcl/(cmd)/lib'`, so the rendered line is `''/tcl/(cmd)/lib''`. fish concatenates the adjacent quoted runs and expands the `(cmd)` left between them. The same doubling also splits a path containing a space into two list elements, corrupting `TCL_LIBRARY` and `TK_LIBRARY`.\n\nThis is the same defect class as GHSA-x78j-v8h9-3j2q, which covered `activate.bat`.\n\n### Patches\n\nFixed in 21.7.13 by moving the placeholders outside the surrounding quotes, so each value keeps only the quoting `shlex.quote` applied. Fix: https://github.com/pypa/virtualenv/pull/3252\n\n### Workarounds\n\nAvoid creating or distributing virtual environments whose path contains `'`, `` ` ``, `$`, `;`, `(` or `)`, and inspect the generated activation script before sourcing one you did not create.","categories":["Libraries & packages"],"product":"virtualenv","vendor":"pypa","ecosystem":"pip","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-p58f-9548-mpm2","source_modified_at":"2026-10-01T15:09:19Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"pip","name":"virtualenv"},"range":"<= 21.7.12"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-102925","source_modified_at":"2026-09-30T19:25:16.653Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"virtualenv","vendor":"pypa","versions":[{"status":"affected","version":"< 21.7.13"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-p58f-9548-mpm2","source_modified_at":"2026-10-06T15:25:40.633713827Z","fetched_at":"2026-10-23T18:48:36.087640Z","package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.7.13"}]}],"versions":["0.8","0.8.1","0.8.2","0.8.3","0.8.4","0.9","0.9.1","0.9.2","1.0","1.1","1.10","1.10.1","1.11","1.11.1","1.11.2","1.11.3","1.11.4","1.11.5","1.11.6","1.2","1.3","1.3.1","1.3.2","1.3.3","1.3.4","1.4","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5","1.4.6","1.4.7","1.4.8","1.4.9","1.4rc1","1.5","1.5.1","1.5.2","1.6","1.6.1","1.6.2","1.6.3","1.6.4","1.7","1.7.1","1.7.1.1","1.7.1.2","1.7.2","1.8"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-p58f-9548-mpm2","source_modified_at":"2026-10-01T15:09:19Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"pip","name":"virtualenv"},"version":"21.7.13"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-p58f-9548-mpm2","source_modified_at":"2026-10-06T15:25:40.633713827Z","fetched_at":"2026-10-23T18:48:36.087640Z","package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"version":"21.7.13"}],"cvss":7.8,"severity":"High","kev":{"listed":false},"epss":{"probability":0.00153,"percentile":0.04086,"score_date":"2026-10-23"},"published_at":"2026-09-29T20:50:57.199Z","modified_at":"2026-10-06T15:25:40.633713827Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-p58f-9548-mpm2","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-01T15:09:19Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-102925","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-09-30T19:25:16.653Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-p58f-9548-mpm2","fetched_at":"2026-10-23T18:48:36.087640Z","source_modified_at":"2026-10-06T15:25:40.633713827Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-102925","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-p58f-9548-mpm2","tags":["x_refsource_CONFIRM"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-102925","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://github.com/pypa/virtualenv/pull/3252","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/pypa/virtualenv/commit/4d5a105ec2a2723b8c7f4571bb68f4f71d01e3f6","tags":["x_refsource_MISC"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4013.yaml","source":"GitHub Advisory Database"},{"url":"https://github.com/pypa/virtualenv","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://github.com/pypa/virtualenv/releases/tag/21.7.13","tags":["x_refsource_MISC"]},{"url":"https://pypi.org/project/virtualenv","source":"GitHub Advisory Database"},{"url":"https://github.com/advisories/GHSA-p58f-9548-mpm2","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"none","automatable":"no","technical_impact":"total","assessed_at":"2026-09-30T19:24:23.430338Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"product","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-06T15:25:40.633713827Z","content_hash":"ef26a0aa72a859523eb9be7debbb60467e43844ed9772c7f5d48016a4cf84cad"}}
