Medium, CVSS 6.8crates.ioPublished
gix-transport: HTTP credentials leaked to redirected host in curl backend
GHSA-9857-6mw7-fq2m
- Affected
- crates.io gix-transport >= 0.25.4, <= 0.55.0
- Fixed in
- 0.56.0· Vendor fix available
- Issue
- The curl-based HTTP transport in gix-transport sends user credentials (passwords, tokens) to an attacker-controlled server after an HTTP redirect. When a server responds with a 302 redirect during the initial GET /info/refs, gitoxide records the redirected base URL and rewrites all subsequent requests to point at the redirected host. The Authorization header is still attached because addbasicauthifpresent() only checks self.url (the original, never-updated URL). The reqwest backend is not affected. Its custom redirect policy at reqwest/remote.rs lines 60-64 compares prevurl.hoststr() to currurl.hoststr() and calls attempt.stop() on cross-domain redirects, so redirectedbaseurl is never set to a different host. Details The vulnerability involves two components in gix-transport: 1. URL rewriting after redirect (gix-transport/src/client/blockingio/http/curl/remote.rs) After a request completes, the effective URL is compared to the requested URL. If they differ (redirect…
Recommended action: Upgrade to 0.56.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.