reject file:// urls in pylock packages fetched from a URL#14174
Open
Arawoof06 wants to merge 2 commits into
Open
reject file:// urls in pylock packages fetched from a URL#14174Arawoof06 wants to merge 2 commits into
Arawoof06 wants to merge 2 commits into
Conversation
Signed-off-by: abdul rawoof <abdulr@bugqore.com>
Arawoof06
force-pushed
the
pylock-remote-url-scheme
branch
from
July 14, 2026 11:50
7c2f5e5 to
dab7196
Compare
Member
|
Like with all of the other PRs, I still take issue with the comments. Keep them brief, please. Also, this is not a security vulnerability as we assume that pip is being handed trusted input. Otherwise, I'll leave this for review by @sbidoul. |
Signed-off-by: abdul rawoof <abdulr@bugqore.com>
Contributor
Author
|
Trimmed the comment down to a single line. And noted on the threat model - I'll drop the security framing; the behaviour change still seems worth having for consistency with the path branch and the directory-entry check. Happy to let sbidoul take it from here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
When a
pylock.tomlis fetched from an http(s) URL,_package_dist_urlreturns a package'surlfield unchanged, so an entry withurl = "file:///etc/passwd"(orfile://host/share/pkg.whlon Windows) makes pip read a local file or reach an SMB share even though the lock came from a remote server. #14159 closed this for the relativepathfield, andpackage_directory_requirement_urlalready refuses local targets for directory entries; this applies the same rule to theurlfield used by wheel/sdist/archive/vcs packages, while still letting a remote lock reference other http(s) hosts.PR Checklist: