Skip to content

Conversation

@ejortega
Copy link

@ejortega ejortega commented Jan 6, 2026

Fix duplicate path in ZIP extraction

zip.extract() already appends the member filename to the targetpath.

This caused locations to appear as pkg/file.py/pkg/file.py instead of pkg/file.py.

Example extracted package:

$ ls -R validatekey-0.0.13-py3-none-any
validate key                 validatekey-0.0.13.dist-info

validatekey-0.0.13-py3-none-any/validate key:
__init__.py tools.py    utils.py

validatekey-0.0.13-py3-none-any/validatekey-0.0.13.dist-info:
LICENSE       METADATA      RECORD        WHEEL         top_level.txt

Running guarddog on this package yields the following with incorrect locations.

    ...
    "shady-links": [
      {
        "location": "validate key/tools.py/validate key/tools.py:12",
        "code": "discordWebhook=str(\"https://discord.com/api/webhooks/...\")\n",
        "message": "This package contains an URL to a domain with a suspicious extension"
      },
      {
        "location": "validate key/utils.py/validate key/utils.py:17",
        "code": "        self.webhook = \"https://discord.com/api/webhooks/...\"\n",
        "message": "This package contains an URL to a domain with a suspicious extension"
      },
      {
        "location": "validate key/utils.py/validate key/utils.py:213",
        "code": "            r = requests.get(\"https://discord.com/api/v9/users/@me\", headers=self.getheaders(token))\n",
        "message": "This package contains an URL to a domain with a suspicious extension"
      },
      {
        "location": "validate key/utils.py/validate key/utils.py:218",
        "code": "                j = requests.get(\"https://discord.com/api/v9/users/@me\", headers=self.getheaders(token)).json()\n",
        "message": "This package contains an URL to a domain with a suspicious extension"
      },
      {
        "location": "validate key/utils.py/validate key/utils.py:270",
        "code": "            data = requests.get(\"http://ipinfo.io/json\").json()\n",
        "message": "This package contains an URL to a domain with a suspicious extension"
      }
    ],
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant