Repository navigation
Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. - #17484
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @epage (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
| let mut gix_url = gix::url::parse(gix::bstr::BStr::new(url.as_bytes())).ok()?; | ||
| if gix_url.serialize_alternative_form && gix_url.scheme == gix::url::Scheme::Ssh { | ||
| gix_url.serialize_alternative_form = false; | ||
| if !gix_url.path.starts_with(b"/") { |
There was a problem hiding this comment.
Just wanted opinions on whether doing this is safe and appropriate. I'm happy to update this to whatever is best.
From https://github.com/rust-lang/cargo/blob/master/src/sources/git/utils.rs#L498, it looks like we convert to SSH-form for SourceId, but the original SCP URL is preserved for fetching.
Moreover, from https://github.com/GitoxideLabs/gitoxide/blob/main/gix-url/src/lib.rs#L811, it looks like / would be prepended to the paths, as well, prior to the newly added check.
There was a problem hiding this comment.
I did some digging, and I think that adding the / back is correct. One thing that would be helpful is to add tests for the old behavior in a commit before this change; then, in this commit, it would show that this change doesn't affect anything.
|
r? @weihanglo Hi @weihanglo - do you by any chance have any opinions on this change? |
| if !gix_url.path.starts_with(b"/") { | ||
| let mut new_path = gix::bstr::BString::from(b"/".as_slice()); | ||
| new_path.extend_from_slice(&gix_url.path); | ||
| gix_url.path = new_path; | ||
| } |
There was a problem hiding this comment.
| if !gix_url.path.starts_with(b"/") { | |
| let mut new_path = gix::bstr::BString::from(b"/".as_slice()); | |
| new_path.extend_from_slice(&gix_url.path); | |
| gix_url.path = new_path; | |
| } | |
| if !gix_url.path.starts_with(b"/") && !gix_url.path.starts_with(b"~") { | |
| gix_url.path.insert(0, b'/'); | |
| } |
This would make it match the check in gix-url
| let mut gix_url = gix::url::parse(gix::bstr::BStr::new(url.as_bytes())).ok()?; | ||
| if gix_url.serialize_alternative_form && gix_url.scheme == gix::url::Scheme::Ssh { | ||
| gix_url.serialize_alternative_form = false; | ||
| if !gix_url.path.starts_with(b"/") { |
There was a problem hiding this comment.
I did some digging, and I think that adding the / back is correct. One thing that would be helpful is to add tests for the old behavior in a commit before this change; then, in this commit, it would show that this change doesn't affect anything.
|
@Muscraft Thank you for your review! A quick clarification question, if that's alright:
Would the tests be in this same file ( |
|
Placing them in the same file in the |
|
Will be following up with another PR for the test case. |
cca7d86 to
aca13f5
Compare
This change adds unit tests for `scp_to_ssh` in `src/sources/git/utils.rs` to assert that the expected conversion behavior of various standard and non-SCP URLs. This test establishes a baseline for the existing URL parsing and conversion before any subsequent behavior-changing fixes or features are applied.
…eatures, gix-credentials) to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0.
aca13f5 to
a4ae517
Compare
This update is motivated by greatly improved error handling, and of course plenty of fixes, also security related. <!-- agent --> Upgrade gix from 0.85.0 to the latest non-yanked release (2026-10-08) and refresh its dependency graph. Align the test-only gix-transport requirement with 0.61.0 so http-client-insecure-credentials is enabled on the same transport used by gix; otherwise HTTP authentication tests cannot send credentials to their local test server. Adapt Cargo to the upstream changes: - gix removed operation-specific error aliases and the fetch collation enum, and standardized public failures on gix::Error. Use that shared error type, remove obsolete conversions, and inspect retained causes and classifications instead of matching the removed enum variants. GitoxideLabs/gitoxide@2176245 GitoxideLabs/gitoxide@9a5777e - The protocol error migration removed Credentials, InvalidCredentials, and LockShallowFile variants. Preserve credential-helper failures with a local error wrapper, use AuthenticationRequired to identify rejected HTTP credentials, and retain Cargo's existing authentication/network hints and original causes. Recover stale shallow locks only when an AlreadyExists I/O cause accompanies an existing shallow.lock file. GitoxideLabs/gitoxide@5d71252 - The transport error migration removed IsSpuriousError. Use gix's can_retry_lenient policy for transient I/O and classified failures, while respecting cancellation. GitoxideLabs/gitoxide@2c373b2 - Path conversions now return encoding errors instead of panicking. Propagate those errors in package file discovery, VCS status pathspecs, and shallow-fetch assertions. is_shallow and shallow_file became fallible as part of the same change. GitoxideLabs/gitoxide@029c597 - Lossless SSH serialization now retains SCP syntax for relative paths, even when alternate-form serialization is disabled. Make the path absolute only in Cargo's internal cache URL so it can be parsed by SourceId, while preserving the original SCP URL for the actual fetch. GitoxideLabs/gitoxide@ae22b87 Migrate the preceding commit's authentication, retry, and shallow-lock error fixtures to gix 0.89.0. Keep its HTTP credential-exchange and SCP cache-URL tests unchanged so they cover behavior across the update. Existing shallow-fetch tests cover recovery after an interrupted fetch. The SCP cache-URL test passes on both dependency versions and fails on gix 0.89.0 when the leading-slash adaptation is removed: serialization retains `[email protected]:foo/bar.git`, which SourceId cannot parse. Tilde paths already have a lossless canonical SSH spelling and need no mutation. See rust-lang#17484 (comment). LLM disclosure: Implemented and tested by Codex at Byron's request. Assisted-by: GPT 6.1 Sol
This update is motivated by greatly improved error handling, and of course plenty of fixes, also security related. <!-- agent --> Upgrade gix from 0.85.0 to the latest non-yanked release (2026-10-08) and refresh its dependency graph. Align the test-only gix-transport requirement with 0.61.0 so http-client-insecure-credentials is enabled on the same transport used by gix; otherwise HTTP authentication tests cannot send credentials to their local test server. Adapt Cargo to the upstream changes: - gix removed operation-specific error aliases and the fetch collation enum, and standardized public failures on gix::Error. Use that shared error type, remove obsolete conversions, and inspect retained causes and classifications instead of matching the removed enum variants. GitoxideLabs/gitoxide@2176245 GitoxideLabs/gitoxide@9a5777e - The protocol error migration removed Credentials, InvalidCredentials, and LockShallowFile variants. Preserve credential-helper failures with a local error wrapper, use AuthenticationRequired to identify rejected HTTP credentials, and retain Cargo's existing authentication/network hints and original causes. Recover stale shallow locks only when an AlreadyExists I/O cause accompanies an existing shallow.lock file. GitoxideLabs/gitoxide@5d71252 - The transport error migration removed IsSpuriousError. Use gix's can_retry_lenient policy for transient I/O and classified failures, while respecting cancellation. GitoxideLabs/gitoxide@2c373b2 - Path conversions now return encoding errors instead of panicking. Propagate those errors in package file discovery, VCS status pathspecs, and shallow-fetch assertions. is_shallow and shallow_file became fallible as part of the same change. GitoxideLabs/gitoxide@029c597 - Lossless SSH serialization now retains SCP syntax for relative paths, even when alternate-form serialization is disabled. Make the path absolute only in Cargo's internal cache URL so it can be parsed by SourceId, while preserving the original SCP URL for the actual fetch. GitoxideLabs/gitoxide@ae22b87 Migrate the preceding commit's authentication, retry, and shallow-lock error fixtures to gix 0.89.0. Keep its HTTP credential-exchange and SCP cache-URL tests unchanged so they cover behavior across the update. Existing shallow-fetch tests cover recovery after an interrupted fetch. The SCP cache-URL test passes on both dependency versions and fails on gix 0.89.0 when the leading-slash adaptation is removed: serialization retains `[email protected]:foo/bar.git`, which SourceId cannot parse. Tilde paths already have a lossless canonical SSH spelling and need no mutation. See rust-lang#17484 (comment). LLM disclosure: Implemented and tested by Codex at Byron's request. Assisted-by: GPT 6.1 Sol
This update is motivated by greatly improved error handling, and of course plenty of fixes, also security related. <!-- agent --> Upgrade gix from 0.85.0 to the latest non-yanked release (2026-10-08) and refresh its dependency graph. Align the test-only gix-transport requirement with 0.61.0 so http-client-insecure-credentials is enabled on the same transport used by gix; otherwise HTTP authentication tests cannot send credentials to their local test server. Adapt Cargo to the upstream changes: - gix removed operation-specific error aliases and the fetch collation enum, and standardized public failures on gix::Error. Use that shared error type, remove obsolete conversions, and inspect retained causes and classifications instead of matching the removed enum variants. GitoxideLabs/gitoxide@2176245 GitoxideLabs/gitoxide@9a5777e - The protocol error migration removed Credentials, InvalidCredentials, and LockShallowFile variants. Preserve credential-helper failures with a local error wrapper, use AuthenticationRequired to identify rejected HTTP credentials, and retain Cargo's existing authentication/network hints and original causes. Recover stale shallow locks only when an AlreadyExists I/O cause accompanies an existing shallow.lock file. GitoxideLabs/gitoxide@5d71252 - The transport error migration removed IsSpuriousError. Use gix's can_retry_lenient policy for transient I/O and classified failures, while respecting cancellation. GitoxideLabs/gitoxide@2c373b2 - Path conversions now return encoding errors instead of panicking. Propagate those errors in package file discovery, VCS status pathspecs, and shallow-fetch assertions. is_shallow and shallow_file became fallible as part of the same change. GitoxideLabs/gitoxide@029c597 - Lossless SSH serialization now retains SCP syntax for relative paths, even when alternate-form serialization is disabled. Make the path absolute only in Cargo's internal cache URL so it can be parsed by SourceId, while preserving the original SCP URL for the actual fetch. GitoxideLabs/gitoxide@ae22b87 Migrate the preceding commit's authentication, retry, and shallow-lock error fixtures to gix 0.89.0. Keep its HTTP credential-exchange and SCP cache-URL tests unchanged so they cover behavior across the update. Existing shallow-fetch tests cover recovery after an interrupted fetch. The SCP cache-URL test passes on both dependency versions and fails on gix 0.89.0 when the leading-slash adaptation is removed: serialization retains `[email protected]:foo/bar.git`, which SourceId cannot parse. Tilde paths already have a lossless canonical SSH spelling and need no mutation. See rust-lang#17484 (comment). LLM disclosure: Implemented and tested by Codex at Byron's request. Assisted-by: GPT 6.1 Sol
Update cargo submodule 12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84 2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000 - feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613) - chore(gh): Overhaul PR template (rust-lang/cargo#17612) - fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600) - feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602) - refactor(confg): Create a config abstraction (rust-lang/cargo#17606) - fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594) - Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574) - fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599) - fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521) - Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484) - fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589) - refactor(parser): Simplify dep source validation (rust-lang/cargo#17506) r? ghost
Update cargo submodule 12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84 2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000 - feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613) - chore(gh): Overhaul PR template (rust-lang/cargo#17612) - fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600) - feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602) - refactor(confg): Create a config abstraction (rust-lang/cargo#17606) - fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594) - Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574) - fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599) - fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521) - Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484) - fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589) - refactor(parser): Simplify dep source validation (rust-lang/cargo#17506) r? ghost
This update is motivated by greatly improved error handling, and of course plenty of fixes, also security related. <!-- agent --> Upgrade gix from 0.85.0 to 0.90.0 and refresh its dependency graph. Align the test-only gix-transport requirement with 0.62.0 so http-client-insecure-credentials is enabled on the same transport used by gix; otherwise HTTP authentication tests cannot send credentials to their local test server. Adapt Cargo to the upstream changes: - gix removed operation-specific error aliases and the fetch collation enum, and standardized public failures on gix::Error. Use that shared error type, remove obsolete conversions, and inspect retained causes and classifications instead of matching the removed enum variants. GitoxideLabs/gitoxide@2176245 GitoxideLabs/gitoxide@9a5777e - The protocol error migration removed Credentials, InvalidCredentials, and LockShallowFile variants. Preserve credential-helper failures with a local error wrapper, use AuthenticationRequired to identify rejected HTTP credentials, and retain Cargo's existing authentication/network hints and original causes. Recover stale shallow locks only when an AlreadyExists I/O cause accompanies an existing shallow.lock file. GitoxideLabs/gitoxide@5d71252 - The transport error migration removed IsSpuriousError. Use gix's can_retry_lenient policy for transient I/O and classified failures, while respecting cancellation. GitoxideLabs/gitoxide@2c373b2 - Path conversions now return encoding errors instead of panicking. Propagate those errors in package file discovery, VCS status pathspecs, and shallow-fetch assertions. is_shallow and shallow_file became fallible as part of the same change. GitoxideLabs/gitoxide@029c597 - Lossless SSH serialization now retains SCP syntax for relative paths, even when alternate-form serialization is disabled. Make the path absolute only in Cargo's internal cache URL so it can be parsed by SourceId, while preserving the original SCP URL for the actual fetch. GitoxideLabs/gitoxide@ae22b87 Migrate the preceding commit's authentication, retry, and shallow-lock error fixtures to gix 0.90.0. Keep its HTTP credential-exchange and SCP cache-URL tests unchanged so they cover behavior across the update. Existing shallow-fetch tests cover recovery after an interrupted fetch. The SCP cache-URL test passes on both dependency versions and fails on gix 0.89.0 when the leading-slash adaptation is removed: serialization retains `[email protected]:foo/bar.git`, which SourceId cannot parse. Tilde paths already have a lossless canonical SSH spelling and need no mutation. See rust-lang#17484 (comment). Validation with gix 0.90.0: all 190 Cargo unit tests and 490 affected integration tests passed with the default curl transport. The reqwest transport passed 36 focused unit tests and 26 shallow-fetch/authentication integration tests. Formatting and diff whitespace checks passed. LLM disclosure: Implemented and tested by Codex at Byron's request. Assisted-by: GPT 6.1 Sol
Update cargo submodule 12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84 2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000 - feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613) - chore(gh): Overhaul PR template (rust-lang/cargo#17612) - fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600) - feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602) - refactor(confg): Create a config abstraction (rust-lang/cargo#17606) - fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594) - Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574) - fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599) - fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521) - Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484) - fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589) - refactor(parser): Simplify dep source validation (rust-lang/cargo#17506) r? ghost
Update cargo submodule 12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84 2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000 - feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613) - chore(gh): Overhaul PR template (rust-lang/cargo#17612) - fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600) - feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602) - refactor(confg): Create a config abstraction (rust-lang/cargo#17606) - fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594) - Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574) - fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599) - fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521) - Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484) - fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589) - refactor(parser): Simplify dep source validation (rust-lang/cargo#17506) r? ghost
Update cargo submodule 12 commits in 3960fa69bb617e3d93c4ddc087c1b32bf12ad907..15be64aa0859b5c36f7a86d52f7aa0db44ba4d84 2026-10-12 19:29:05 +0000 to 2026-10-20 16:03:21 +0000 - feat(prerelease): support `[patch]` with `-Zprerelease` (rust-lang/cargo#17613) - chore(gh): Overhaul PR template (rust-lang/cargo#17612) - fix(util-schemas): compile out the file-path hint where url can't build it (rust-lang/cargo#17600) - feat(build-std): Add build.build-std.when and crates config keys (rust-lang/cargo#17602) - refactor(confg): Create a config abstraction (rust-lang/cargo#17606) - fix(config): Apply dotted tuple support for rustflags (rust-lang/cargo#17594) - Feat: Shell completion show all the packages having the feature (rust-lang/cargo#17574) - fix(config): Don't load registry config from credentials.toml (rust-lang/cargo#17599) - fix(fingerprint): choose a stable path when source mtimes tie (rust-lang/cargo#17521) - Update gix crates to address CVE-2026-82248, CVE-2026-82249, and CVE-2026-82250, and update git utils.rs to accommodate gix-url v0.38.0. (rust-lang/cargo#17484) - fix: check crate type when pruning `-L` paths (rust-lang/cargo#17589) - refactor(parser): Simplify dep source validation (rust-lang/cargo#17506) r? ghost
This PR attempts to achieve the following:
scp_to_sshfails to convert a SCP-like URL to SSH format as gix-url v0.38.0 appears to reject serializing a SSH path (with no leading/to canonical SSH form. This fix prepends/prior to converting to SSH form.