Skip to content

More fully sanitize the filename in PackageIndex._download_url#4951

Merged
jaraco merged 5 commits into
mainfrom
security/4946
Apr 19, 2025
Merged

More fully sanitize the filename in PackageIndex._download_url#4951
jaraco merged 5 commits into
mainfrom
security/4946

Conversation

@jaraco
Copy link
Copy Markdown
Member

@jaraco jaraco commented Apr 19, 2025

  • Extract _resolve_download_filename with test.
  • Add a check to ensure the name resolves relative to the tmpdir.
  • Extract _sanitize method for sanitizing the filename.
  • Rely on re.sub to perform the decision in one expression.
  • Add news fragment.

Summary of changes

Closes

Pull Request Checklist

@jaraco jaraco merged commit 100e9a6 into main Apr 19, 2025
38 of 42 checks passed
@jaraco jaraco deleted the security/4946 branch April 19, 2025 18:02
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