Search

Find a vulnerability

Search criteria

    Related vulnerabilities

    BREW-ANSIBLE-BUILDER-GHS… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:28 – Updated: 2026-10-29 21:28 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "ansible-builder",
            "purl": "pkg:brew/ansible-builder"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.1.0"
                },
                {
                  "fixed": "3.2.0_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-ansible-builder-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:28:36Z",
      "published": "2026-10-29T21:28:36Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-ANSIBLE-GHSA-XMJ3-9… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:32 – Updated: 2026-10-29 21:32 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "ansible",
            "purl": "pkg:brew/ansible"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "9.2.0"
                },
                {
                  "fixed": "14.5.0_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-ansible-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:32:40Z",
      "published": "2026-10-29T21:32:40Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-ANSIBLE@10-GHSA-XMJ… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:53 – Updated: 2026-10-29 21:53 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@80.9.0",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "ansible@10",
            "purl": "pkg:brew/ansible%4010"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "10.6.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@80.9.0",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "80.9.0"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-ansible@10-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:53:03Z",
      "published": "2026-10-29T21:53:03Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-ANSIBLE@12-GHSA-XMJ… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:29 – Updated: 2026-10-29 21:29 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.0.0",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "ansible@12",
            "purl": "pkg:brew/ansible%4012"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "12.2.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.0.0",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.0.0"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-ansible@12-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:29:09Z",
      "published": "2026-10-29T21:29:09Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-ANSIBLE@13-GHSA-XMJ… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-26 10:21 – Updated: 2026-10-26 10:21 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.0.0",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "ansible@13",
            "purl": "pkg:brew/ansible%4013"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "13.7.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.0.0",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.0.0"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-ansible@13-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-26T10:21:44Z",
      "published": "2026-10-26T10:21:44Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-ANSIBLE@9-GHSA-XMJ3… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-24 08:45 – Updated: 2026-10-24 08:45 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@80.9.0",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "ansible@9",
            "purl": "pkg:brew/ansible%409"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "9.6.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@80.9.0",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "80.9.0"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-ansible@9-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-24T08:45:16Z",
      "published": "2026-10-24T08:45:16Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-APM-GHSA-XMJ3-9GF7-H52W (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:30 – Updated: 2026-10-29 21:30 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "apm",
            "purl": "pkg:brew/apm"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "0.26.0"
                },
                {
                  "fixed": "0.35.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-apm-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:30:32Z",
      "published": "2026-10-29T21:30:32Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-AWS-SAM-CLI-GHSA-XM… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-26 10:23 – Updated: 2026-10-26 10:23 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "aws-sam-cli",
            "purl": "pkg:brew/aws-sam-cli"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.107.0"
                },
                {
                  "fixed": "1.170.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-aws-sam-cli-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-26T10:23:14Z",
      "published": "2026-10-26T10:23:14Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-BACKGROUNDREMOVER-G… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-28 08:39 – Updated: 2026-10-28 08:39 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.0.0",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "backgroundremover",
            "purl": "pkg:brew/backgroundremover"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "0.4.5_2"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.0.0",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.0.0"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-backgroundremover-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-28T08:39:24Z",
      "published": "2026-10-28T08:39:24Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-BASHATE-GHSA-XMJ3-9… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 22:00 – Updated: 2026-10-29 22:00 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "bashate",
            "purl": "pkg:brew/bashate"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.1.1_2"
                },
                {
                  "fixed": "2.1.1_4"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-bashate-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T22:00:30Z",
      "published": "2026-10-29T22:00:30Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-BAZARR-GHSA-XMJ3-9G… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:31 – Updated: 2026-10-29 21:31 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "bazarr",
            "purl": "pkg:brew/bazarr"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.4.3"
                },
                {
                  "fixed": "1.6.2_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-bazarr-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:31:41Z",
      "published": "2026-10-29T21:31:41Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-BZT-GHSA-XMJ3-9GF7-H52W (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 22:06 – Updated: 2026-10-29 22:06 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@80.10.2",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "bzt",
            "purl": "pkg:brew/bzt"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.16.3"
                },
                {
                  "fixed": "1.16.8"
                },
                {
                  "introduced": "1.16.29"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@80.10.2",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "80.10.2"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-bzt-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T22:06:00Z",
      "published": "2026-10-29T22:06:00Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-CCM-GHSA-XMJ3-9GF7-H52W (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-26 10:24 – Updated: 2026-10-26 10:24 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "ccm",
            "purl": "pkg:brew/ccm"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.1.5_3"
                },
                {
                  "fixed": "3.1.5_7"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-ccm-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-26T10:24:10Z",
      "published": "2026-10-26T10:24:10Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-CHARM-TOOLS-GHSA-XM… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:30 – Updated: 2026-10-29 21:30 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@81.0.0",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "charm-tools",
            "purl": "pkg:brew/charm-tools"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.0.7_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@81.0.0",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "81.0.0"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-charm-tools-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:30:57Z",
      "published": "2026-10-29T21:30:57Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-CLOUDFORMATION-CLI-… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:01 – Updated: 2026-10-26 09:01 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "cloudformation-cli",
            "purl": "pkg:brew/cloudformation-cli"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "0.2.35_1"
                },
                {
                  "fixed": "0.2.41_3"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-cloudformation-cli-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-26T09:01:09Z",
      "published": "2026-10-26T09:01:09Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-COCONUT-GHSA-XMJ3-9… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:58 – Updated: 2026-10-29 21:58 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "coconut",
            "purl": "pkg:brew/coconut"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.0.4"
                },
                {
                  "fixed": "3.2.0_4"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-coconut-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:58:09Z",
      "published": "2026-10-29T21:58:09Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-CONDA-LOCK-GHSA-XMJ… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:39 – Updated: 2026-10-29 21:39 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "conda-lock",
            "purl": "pkg:brew/conda-lock"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.5.5"
                },
                {
                  "fixed": "4.0.3_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-conda-lock-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T21:39:28Z",
      "published": "2026-10-29T21:39:28Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-CVE-BIN-TOOL-GHSA-X… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 22:00 – Updated: 2026-10-29 22:00 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "cve-bin-tool",
            "purl": "pkg:brew/cve-bin-tool"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "3.4"
                },
                {
                  "fixed": "3.4_4"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-cve-bin-tool-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T22:00:18Z",
      "published": "2026-10-29T22:00:18Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-DATASETTE-GHSA-XMJ3… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-28 08:41 – Updated: 2026-10-28 08:41 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "datasette",
            "purl": "pkg:brew/datasette"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "0.64.6_1"
                },
                {
                  "fixed": "0.65.5_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-datasette-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-28T08:41:15Z",
      "published": "2026-10-28T08:41:15Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }

    BREW-DNSVIZ-GHSA-XMJ3-9G… (GHSA-XMJ3-9GF7-H52W)

    Vulnerability from osv_homebrew – Published: 2026-10-29 22:04 – Updated: 2026-10-29 22:04 – Source website
    VLAI
    Summary
    setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
    Details

    Summary

    On Windows, attacker-controlled content in a wheel's .dist-info/namespace_packages.txt can cause setuptools' legacy wheel installation path to create an __init__.py outside the requested destination_eggdir.

    The attacker can influence the destination path, but not the contents of the created file.

    Details

    Tested setuptools commit:

    6ead555c5fb29bc57fe6105b1bffc163f56fd558

    Relevant source:

    setuptools/wheel.py

    SHA-256:

    359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd

    The relevant call path is:

    Wheel(wheel_path).install_as_egg(destination) → _install_as_egg → _convert_metadata → _fix_namespace_packages

    A wheel can provide attacker-controlled content in:

    <distribution>.dist-info/namespace_packages.txt

    The namespace value is eventually used approximately as:

    mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
    mod_init = os.path.join(mod_dir, '__init__.py')
    
    If mod is a Windows drive-qualified absolute path containing no dots,
    mod.split('.') preserves it as a single component.
    On Windows, os.path.join(destination_eggdir, absolute_component) discards
    the original base directory and resolves to the attacker-supplied absolute
    path.
    The existing wheel filename and ZIP traversal checks do not validate this
    metadata value before it is subsequently interpreted as a filesystem path.
    
    ```markdown
    ### PoC
    
    The reproduction was performed entirely inside a disposable temporary
    directory.
    
    Layout:
    
    ```text
    sandbox/
        destination/
        outside/
        input/
        canary.txt
    

    A synthetic wheel was created containing:

    demo_pkg-1.0.dist-info/namespace_packages.txt

    whose content was the absolute path of:

    sandbox\outside

    The real acquired setuptools implementation was then invoked:

    setuptools.wheel.Wheel(synthetic_wheel).install_as_egg(
        sandbox_destination
    )
    

    The operation completed without exception.

    Expected metadata was created under:

    sandbox\destination\EGG-INFO

    but setuptools also created:

    sandbox\outside\__init__.py

    The file did not exist before execution.

    Its contents were:

    __import__('pkg_resources').declare_namespace(__name__)
    

    The unrelated canary remained byte-identical.

    The sandbox was deleted after recording the evidence. ```

    Impact

    A crafted wheel can cause setuptools to create a fixed-content __init__.py outside the intended installation directory at a filesystem path influenced by the wheel, with the permissions of the process performing the installation.

    The demonstrated reproduction required the target parent directory to already exist.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "setuptools",
            "resource_purl": "pkg:pypi/setuptools@84.2.1",
            "upstream_fixed_in": "84.1.0"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "dnsviz",
            "purl": "pkg:brew/dnsviz"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "0.11.2"
                },
                {
                  "fixed": "0.11.2_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/setuptools@84.2.1",
            "name": "setuptools",
            "resource": "setuptools",
            "strategy": "registry",
            "subject_version": "84.2.1"
          }
        ]
      },
      "details": "### Summary\n\nOn Windows, attacker-controlled content in a wheel\u0027s\n`.dist-info/namespace_packages.txt` can cause setuptools\u0027 legacy wheel\ninstallation path to create an `__init__.py` outside the requested\n`destination_eggdir`.\n\nThe attacker can influence the destination path, but not the contents of\nthe created file.\n\n### Details\n\nTested setuptools commit:\n\n`6ead555c5fb29bc57fe6105b1bffc163f56fd558`\n\nRelevant source:\n\n`setuptools/wheel.py`\n\nSHA-256:\n\n`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`\n\nThe relevant call path is:\n\n`Wheel(wheel_path).install_as_egg(destination)`\n\u2192 `_install_as_egg`\n\u2192 `_convert_metadata`\n\u2192 `_fix_namespace_packages`\n\nA wheel can provide attacker-controlled content in:\n\n`\u003cdistribution\u003e.dist-info/namespace_packages.txt`\n\nThe namespace value is eventually used approximately as:\n\n```python\nmod_dir = os.path.join(destination_eggdir, *mod.split(\u0027.\u0027))\nmod_init = os.path.join(mod_dir, \u0027__init__.py\u0027)\n\nIf mod is a Windows drive-qualified absolute path containing no dots,\nmod.split(\u0027.\u0027) preserves it as a single component.\nOn Windows, os.path.join(destination_eggdir, absolute_component) discards\nthe original base directory and resolves to the attacker-supplied absolute\npath.\nThe existing wheel filename and ZIP traversal checks do not validate this\nmetadata value before it is subsequently interpreted as a filesystem path.\n\n```markdown\n### PoC\n\nThe reproduction was performed entirely inside a disposable temporary\ndirectory.\n\nLayout:\n\n```text\nsandbox/\n    destination/\n    outside/\n    input/\n    canary.txt\n```\n\nA synthetic wheel was created containing:\n\n`demo_pkg-1.0.dist-info/namespace_packages.txt`\n\nwhose content was the absolute path of:\n\n`sandbox\\outside`\n\nThe real acquired setuptools implementation was then invoked:\n\n```python\nsetuptools.wheel.Wheel(synthetic_wheel).install_as_egg(\n    sandbox_destination\n)\n```\n\nThe operation completed without exception.\n\nExpected metadata was created under:\n\n`sandbox\\destination\\EGG-INFO`\n\nbut setuptools also created:\n\n`sandbox\\outside\\__init__.py`\n\nThe file did not exist before execution.\n\nIts contents were:\n\n```python\n__import__(\u0027pkg_resources\u0027).declare_namespace(__name__)\n```\n\nThe unrelated canary remained byte-identical.\n\nThe sandbox was deleted after recording the evidence.\n```\n\n\n### Impact\n\nA crafted wheel can cause setuptools to create a fixed-content\n`__init__.py` outside the intended installation directory at a\nfilesystem path influenced by the wheel, with the permissions of the\nprocess performing the installation.\n\nThe demonstrated reproduction required the target parent directory to\nalready exist.",
      "id": "BREW-dnsviz-GHSA-xmj3-9gf7-h52w",
      "modified": "2026-10-29T22:04:38Z",
      "published": "2026-10-29T22:04:38Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/pull/5329"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/commit/6d07b8d17890dda58d944ac51e58f54af92d52af"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/setuptools"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/setuptools/releases/tag/v84.1.0"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description",
      "upstream": [
        "GHSA-xmj3-9gf7-h52w"
      ]
    }