CVE-2026-53586: libgit2: HTTP transport can leak credentials to an offsite redirect target
Last updated 13 August 2026
Other sources
libgit2 is a portable C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Prior to 1.8.6 and 1.9.5, the built-in HTTP transport in src/libgit2/transports/http.c follows an offsite initial redirect, and handleremoteauth and handleauth pass transport->owner->url instead of transport->server.url to the credential callback when the redirected host returns 401 Unauthorized. A callback that scopes credentials to the original trusted URL can therefore return GITCREDENTIALUSERPASSPLAINTEXT credentials that libgit2 stores in transport->server.cred and sends as an Authorization header to the redirected host. An attacker who controls a trusted Git host or an open redirect on that host can disclose HTTP Basic credentials, personal access tokens, or equivalent credentials. This issue is fixed in versions 1.8.6 and 1.9.5.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/libgit2to a version that resolves this vulnerability.Fixed in 1.9.6+ds-1 - Upgrade
Upgrade
libgit2to a version that resolves this vulnerability.Fixed in 1.8.6 - Upgrade
Upgrade
libgit2to a version that resolves this vulnerability.Fixed in 1.9.5
Event History
Frequently Asked Questions
Which applications are exposed to credential disclosure?
Applications using libgit2’s built-in HTTP transport with a credential callback that supplies HTTP Basic credentials, personal access tokens, or equivalent credentials based on the original repository URL are exposed. The affected behavior is present before libgit2 1.8.6 and 1.9.5.
What does an attacker need to exploit this issue?
The attacker must control a trusted Git host or an open redirect on that trusted host. They can redirect an HTTP transport request to an offsite host that responds with 401 Unauthorized, causing the application’s credential callback to provide credentials scoped to the original URL.
Is user interaction required?
Yes. The supplied severity vector includes UI:R, indicating that user interaction is required. Exploitation also depends on the application following an initial offsite redirect through the built-in HTTP transport.
What should be done if an immediate update is not possible?
Avoid accessing repositories hosted on Git servers that are untrusted or may contain open redirects, and avoid supplying reusable HTTP credentials through affected libgit2 credential callbacks where possible. Updating to libgit2 1.8.6 or 1.9.5 is the documented fix.