Description
go-git is an extensible git implementation library written in pure Go. Prior to versions 5.18.0 and 6.0.0-alpha.2, go-git may leak HTTP authentication credentials when following redirects during smart-HTTP clone and fetch operations. This issue has been patched in versions 5.18.0 and 6.0.0-alpha.2.
Published: 2026-05-08
Score: 4.7 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

go-git, a Go implementation of Git, may inadvertently expose HTTP authentication credentials when it follows redirects during smart‑HTTP clone and fetch operations. The vulnerability allows end‑to‑end authentication details to be leaked to an unintended host, enabling an attacker to capture or reuse those credentials for unauthorized access to the remote repository. This issue falls under CWE‑522, Credential Exposure Through Missing Permissions, and can result in the compromise of private code repositories or sensitive data accessed with those credentials.

Affected Systems

The affected component is the go‑git library, version 5.x before 5.18.0 and version 6.0.0‑alpha.2 before that release. Applications that embed go‑git and perform Git operations over HTTP or HTTPS that automatically follow redirects are impacted. Any project or service that imports go‑git to clone or fetch repositories is potentially vulnerable if the underlying library version is not up to date.

Risk and Exploitability

The CVSS score of 4.7 indicates a moderate severity. EPSS information is not available, and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector involves an attacker controlling a redirect chain during a clone or fetch operation; the attacker would need influence over the initial repository URL or the server issuing the redirect. Exploitation would require network access to the client performing the Git operation. Although exploitation is not trivial and would typically require a targeted scenario, credential leakage poses significant risk in environments where sensitive credentials are transmitted over HTTP. The risk level is moderate, but organizations should still treat it as a priority to mitigate potential credential compromise.

Generated by OpenCVE AI on May 8, 2026 at 19:17 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade go‑git to version 5.18.0 or later, or to 6.0.0‑alpha.2 or newer, to receive the patch that prevents credential leaks during redirects.
  • Disable automatic following of redirects in go‑git configuration or use a custom HTTP client that rejects redirects during smart‑HTTP clone and fetch operations.
  • Rotate any HTTP authentication credentials that may have been exposed and enforce the use of HTTPS for Git operations.

Generated by OpenCVE AI on May 8, 2026 at 19:17 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-3xc5-wrhm-f963 go-git: Credential leak via cross-host redirect in smart HTTP transport
History

Fri, 08 May 2026 14:00:00 +0000

Type Values Removed Values Added
Description go-git is an extensible git implementation library written in pure Go. Prior to versions 5.18.0 and 6.0.0-alpha.2, go-git may leak HTTP authentication credentials when following redirects during smart-HTTP clone and fetch operations. This issue has been patched in versions 5.18.0 and 6.0.0-alpha.2.
Title go-git Credential leak via cross-host redirect in smart HTTP transport
Weaknesses CWE-522
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-05-08T13:43:19.911Z

Reserved: 2026-04-20T18:18:50.681Z

Link: CVE-2026-41506

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-05-08T14:16:33.983

Modified: 2026-05-08T16:02:14.343

Link: CVE-2026-41506

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-08T19:30:05Z

Weaknesses