GHSA-3xc5-wrhm-f963 — v5
MEDIUMGHSA-3xc5-wrhm-f963 is a medium-severity (CVSS 4.7) CWE-522 vulnerability in github.com/go-git/go-git/v5. A fix is available for github.com/go-git/go-git/v5 — see the affected versions and patch details below.
go-git: Credential leak via cross-host redirect in smart HTTP transport
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-3xc5-wrhm-f963.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-3xc5-wrhm-f963 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 379,842 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
github.com/go-git/go-git/v5🐹github.com/go-git/go-git/v6Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Impact
go-git may leak HTTP authentication credentials when following redirects during smart-HTTP clone and fetch operations.
If a remote repository responds to the initial /info/refs request with a redirect to a different host, go-git updates the session endpoint to the redirected location and reuses the original authentication for subsequent requests. This can result in the credentials (e.g. Authorization headers) being sent to an unintended host.
An attacker controlling or influencing the redirect target can capture these credentials and potentially reuse them to access the victim’s repositories or other resources, depending on the scope of the credential.
Clients using go-git exclusively with trusted remotes (for example, GitHub or GitLab), and over a secure HTTPS connection, are not affected by this issue. The risk arises when interacting with untrusted or misconfigured Git servers, or when using unsecured HTTP connections, which is not recommended. Such configurations also expose clients to a broader class of security risks beyond this issue, including credential interception and tampering of repository data.
Patches
Users should upgrade to v5.18.0, or v6.0.0-alpha.2, in order to mitigate this vulnerability. Versions prior to v5 are likely to be affected, users are recommended to upgrade to a supported go-git version.
The patched versions add support for configuring followRedirects. In line with upstream behaviour, the default is now initial, while users can opt into FollowRedirects or NoFollowRedirects programmatically.
Credit
Thanks to the 3 separate reports from @celinke97, @N0zoM1z0 and @AyushParkara. Thanks for finding and reporting this issue privately to the go-git project. :bow:
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/go-git/go-git/v5 | all versions | 5.18.0go get github.com/go-git/go-git/v5@v5.18.0 |
| 🐹Go | github.com/go-git/go-git/v6 | all versions | 6.0.0-alpha.2go get github.com/go-git/go-git/v6@v6.0.0-alpha.2 |
Affected Products
go-gitgo-git_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/go-git/go-git/v5, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/go-git/go-git/v5 to 5.18.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3xc5-wrhm-f963 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat has rated this flaw as Moderate because go-git may disclose HTTP authentication credentials when following redirects during smart HTTP clone and fetch operations but successful exploitation requires a user to interact with a malicious repository or redirect chain, and an attacker must control the redirect…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.Source: Red Hat security advisory for GHSA-3xc5-wrhm-f963 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Hardened Images | syft-main-1.44.0-0.3.hum1 | RHSA-2026:17669 |
| Red Hat Hardened Images | trivy-main-0.72.0-0.1.hum1 | RHSA-2026:35111 |
| Red Hat Openshift Data Foundation 4.22 | odf4/cephcsi-rhel9:1782932114 | RHSA-2026:37387 |
Frequently Asked Questions
Is GHSA-3xc5-wrhm-f963 in your dependencies?
Find it across Go, including transitive dependencies.