Skip to content

Update dependency setuptools to v78 [SECURITY] #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 20, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
setuptools (changelog) ~=70.0.0 -> ~=78.1.1 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2025-47273

Summary

A path traversal vulnerability in PackageIndex was fixed in setuptools version 78.1.1

Details

    def _download_url(self, url, tmpdir):
        # Determine download filename
        #
        name, _fragment = egg_info_for_url(url)
        if name:
            while '..' in name:
                name = name.replace('..', '.').replace('\\', '_')
        else:
            name = "__downloaded__"  # default if URL has no path contents

        if name.endswith('.[egg.zip](http://egg.zip/)'):
            name = name[:-4]  # strip the extra .zip before download

 -->       filename = os.path.join(tmpdir, name)

Here: https://github.com/pypa/setuptools/blob/6ead555c5fb29bc57fe6105b1bffc163f56fd558/setuptools/package_index.py#L810C1-L825C88

os.path.join() discards the first argument tmpdir if the second begins with a slash or drive letter.
name is derived from a URL without sufficient sanitization. While there is some attempt to sanitize by replacing instances of '..' with '.', it is insufficient.

Risk Assessment

As easy_install and package_index are deprecated, the exploitation surface is reduced.
However, it seems this could be exploited in a similar fashion like GHSA-r9hx-vwmv-q579, and as described by POC 4 in GHSA-cx63-2mw6-8hw5 report: via malicious URLs present on the pages of a package index.

Impact

An attacker would be allowed to write files to arbitrary locations on the filesystem with the permissions of the process running the Python code, which could escalate to RCE depending on the context.

References

https://huntr.com/bounties/d6362117-ad57-4e83-951f-b8141c6e7ca5
https://github.com/pypa/setuptools/issues/4946


Release Notes

pypa/setuptools (setuptools)

v78.1.1

Compare Source

v78.1.0

Compare Source

v78.0.2

Compare Source

v78.0.1

Compare Source

v77.0.3

Compare Source

v77.0.1

Compare Source

v76.1.0

Compare Source

v76.0.0

Compare Source

v75.9.1

Compare Source

v75.9.0

Compare Source

v75.8.2

Compare Source

v75.8.1

Compare Source

v75.8.0

Compare Source

v75.7.0

Compare Source

v75.6.0

Compare Source

v75.5.0

Compare Source

v75.4.0

Compare Source

v75.3.2

Compare Source

v75.3.1

Compare Source

v75.3.0

Compare Source

v75.2.0

Compare Source

v75.1.0

Compare Source

v75.0.0

Compare Source

v74.1.3

Compare Source

v74.1.2

Compare Source

v74.1.1

Compare Source

v74.1.0

Compare Source

v74.0.0

Compare Source

v73.0.1

Compare Source

v73.0.0

Compare Source

v72.2.0

Compare Source

v72.1.0

Compare Source

v72.0.0

Compare Source

v71.1.0

Compare Source

v71.0.4

Compare Source

v71.0.3

Compare Source

v71.0.2

Compare Source

v71.0.1

Compare Source

v71.0.0

Compare Source

v70.3.0

Compare Source

v70.2.0

Compare Source

v70.1.1

Compare Source

v70.1.0

Compare Source


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

sourcery-ai bot commented May 20, 2025

Reviewer's Guide

Upgrade setuptools in requirements.txt from ~=70.0.0 to ~=78.1.1 to resolve a path traversal vulnerability (CVE-2025-47273).

Sequence Diagram: CVE-2025-47273 Path Traversal Vulnerability in setuptools < 78.1.1

sequenceDiagram
    autonumber
    actor Attacker
    participant UserProcess as "User Process (using setuptools)"
    participant PackageIndex as "setuptools.PackageIndex._download_url (<78.1.1)"
    participant Utils as "Utility functions (e.g. egg_info_for_url)"
    participant OSPath as "os.path"
    participant Filesystem

    Attacker-->>UserProcess: Provides malicious URL (e.g., in package metadata or index)
    UserProcess->>+PackageIndex: Calls _download_url(malicious_url, "/intended/tmp/dir")
    PackageIndex->>+Utils: egg_info_for_url(malicious_url)
    Utils-->>-PackageIndex: Returns 'name' derived from URL (e.g., "../../../../etc/passwd" or "/etc/passwd")
    PackageIndex->>PackageIndex: Insufficient sanitization of 'name'
    PackageIndex->>+OSPath: join("/intended/tmp/dir", name)
    OSPath-->>-PackageIndex: filename (e.g., "/etc/passwd" or "/intended/tmp/dir/../../../../etc/passwd")
    Note right of OSPath: If 'name' is absolute, initial path is discarded.
    Note right of OSPath: '..' can lead to path traversal.
    PackageIndex->>+Filesystem: Writes downloaded content to 'filename'
    Filesystem-->>-PackageIndex: File written to unintended arbitrary location
    PackageIndex-->>-UserProcess: Operation completes, potentially compromising system
Loading

File-Level Changes

Change Details Files
Upgraded setuptools dependency version
  • Changed version specifier from ~=70.0.0 to ~=78.1.1
requirements.txt

Possibly linked issues

  • #123: The PR updates setuptools to v78.1.1 which is listed as an update in the issue's dependency dashboard.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@renovate renovate bot force-pushed the renovate/pypi-setuptools-vulnerability branch from e1ca4e8 to 7d9964f Compare June 18, 2025 11:49
@renovate renovate bot changed the title Update dependency setuptools to v78 [SECURITY] Update dependency setuptools to ~=70.3.0 [SECURITY] Jun 18, 2025
@renovate renovate bot force-pushed the renovate/pypi-setuptools-vulnerability branch from 7d9964f to 9ee1d0c Compare June 18, 2025 16:30
@renovate renovate bot changed the title Update dependency setuptools to ~=70.3.0 [SECURITY] Update dependency setuptools to v78 [SECURITY] Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants