Repository navigation
Conversation
uv test inventory changesThis PR changes the tests when compared with the
|
a7bf0a9 to
2752244
Compare
| )?; | ||
| } | ||
| if !settings.upgrade.is_none() { | ||
| bail!("Package upgrades cannot be requested with `--requirements`"); |
There was a problem hiding this comment.
This error message seems wrong for AuditSettings?
| if let Some(index) = package.index.as_ref() { | ||
| projects.insert(( | ||
| package.name.clone(), | ||
| IndexUrl::from(VerbatimUrl::from_url(index.clone())), | ||
| )); |
There was a problem hiding this comment.
[P2] Reject remote file indexes before Windows treats them as UNC paths
An on-path attacker who alters an explicitly selected plain-HTTP pylock can set package.index to a hosted file: URL. These lines now promote that untrusted URL into the project-status worklist; IndexUrl classifies every file: URL as a path, and the registry client ultimately calls read_to_string after Url::to_file_path. On Windows, file://attacker/share becomes a UNC path, so the audit can initiate SMB/NTLM authentication to the attacker-controlled host and expose a relayable or crackable challenge response for the invoking developer or CI identity. HTTPS, --no-index, and outbound-SMB policy mitigate the path, but this code should reject hosted file indexes.
| if let Some(index) = package.index.as_ref() { | |
| projects.insert(( | |
| package.name.clone(), | |
| IndexUrl::from(VerbatimUrl::from_url(index.clone())), | |
| )); | |
| if let Some(index) = package.index.as_ref() | |
| && (index.scheme() != "file" | |
| || index | |
| .host_str() | |
| .is_none_or(|host| host.eq_ignore_ascii_case("localhost"))) | |
| { | |
| projects.insert(( | |
| package.name.clone(), | |
| IndexUrl::from(VerbatimUrl::from_url(index.clone())), | |
| )); |
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
c6d9487 to
65bbd3f
Compare
| if let Some(index) = package.index.as_ref() { | ||
| projects.insert(( | ||
| package.name.clone(), | ||
| IndexUrl::from(VerbatimUrl::from_url(index.clone())), |
There was a problem hiding this comment.
[P3] Bind pylock project-status lookups to trusted indexes
When uv audit --requirements reads a pylock over plain HTTP, an on-path attacker can replace the response and choose packages[].index; project-status querying then issues a GET to that HTTP(S) origin, allowing blind requests to otherwise inaccessible loopback or private services from a developer or CI network. Authenticated HTTPS and --no-index prevent this path, but the default plain-HTTP flow does not bind embedded indexes or redirects to operator-authorized destinations.
|
NB I'm deferring this while I think about a cross-cutting approach to tracking the provenance of remote |
Summary
WIP, not ready for review yet.
This adds
uv audit -r pylock.tomlsupport. I've elected for the same CLI design asuv pip install, i.e. an explicit-roption rather than a positional.Note: I intentionally didn't include requirements file support in here, to make the diff (especially the tests) smaller. But adding it would be very easy in a follow-up.
Closes #18422. See #18506.
Test Plan
Added new integration tests.