Description
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, verify_server_cert in src/libgit2/streams/openssl.c uses an inverted !!memcmp result in the GEN_IPADD branch when comparing an IP-literal host with a certificate IP SubjectAltName. OpenSSL builds reject matching IP addresses and accept mismatched IP addresses, allowing a network attacker with a CA-trusted certificate containing any IP SubjectAltName to intercept libgit2 connections to IP-literal HTTPS URLs. DNS SubjectAltName validation and non-OpenSSL TLS backends are not affected. This issue is fixed in versions 1.8.6 and 1.9.5.
Published: 2026-08-20
Score: 6.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

In the libgit2 library, the function verify_server_cert incorrectly compares IP literals against certificate Subject Alternative Names when using an OpenSSL backend. The inverted comparison logic causes OpenSSL to reject matching IP addresses and accept mismatched ones, allowing an attacker to use a CA‑trusted certificate containing any IP SAN to intercept HTTPS connections that target an IP literal. The flaw is limited to IP‑based hostnames; DNS‑based URLs and non‑OpenSSL TLS backends are unaffected. The consequence is an attacker can perform a man‑in‑the‑middle interception of traffic and potentially compromise confidentiality.

Affected Systems

Vulnerability affects libgit2 prior to the release of v1.8.6 and v1.9.5. Systems that link against these older versions and rely on the OpenSSL TLS backend for HTTPS traffic to IP literals are impacted. Any application that uses libgit2 and enables the OpenSSL backend without upgrading is at risk.

Risk and Exploitability

With a CVSS score of 6.5, the vulnerability is considered medium to high severity. No EPSS data is available, and the issue is not listed in the CISA KEV catalog. The likely attack vector is a network attacker who can procure a CA‑trusted certificate containing an arbitrary IP SAN, then target a client that uses an IP literal URL over HTTPS with an OpenSSL backend. Because the flaw allows the client to accept a mismatched IP SAN, the attacker can intercept or tamper with traffic before the client trusts the certificate. Exploitation requires the attacker to be able to influence the certificate presented to the client; once that condition is met the vulnerability is straightforward to trigger.

Generated by OpenCVE AI on August 21, 2026 at 01:48 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade libgit2 to version 1.8.6 or later, or to 1.9.5 or later, to bring in the fixed IP SAN comparison logic.
  • Enforce strict certificate validation per CWE-295 and CWE-297 by ensuring the client rejects certificates whose SAN IP does not match the server IP, or by enabling any strict mode available in the TLS stack.
  • Avoid using IP‑literal HTTPS URLs with the OpenSSL backend; use DNS hostnames for HTTPS connections to mitigate the risk.
  • If an immediate upgrade is not possible, disable the OpenSSL backend or switch to a non‑OpenSSL TLS backend, or implement application‑level validation to reject mismatched IP SAN certificates.

Generated by OpenCVE AI on August 21, 2026 at 01:48 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DSA Debian DSA DSA-6453-1 libgit2 security update
History

Mon, 24 Aug 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


Thu, 20 Aug 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Libgit2
Libgit2 libgit2
Vendors & Products Libgit2
Libgit2 libgit2

Thu, 20 Aug 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 20 Aug 2026 19:00:00 +0000

Type Values Removed Values Added
Description 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, verify_server_cert in src/libgit2/streams/openssl.c uses an inverted !!memcmp result in the GEN_IPADD branch when comparing an IP-literal host with a certificate IP SubjectAltName. OpenSSL builds reject matching IP addresses and accept mismatched IP addresses, allowing a network attacker with a CA-trusted certificate containing any IP SubjectAltName to intercept libgit2 connections to IP-literal HTTPS URLs. DNS SubjectAltName validation and non-OpenSSL TLS backends are not affected. This issue is fixed in versions 1.8.6 and 1.9.5.
Title libgit2: Inverted IP SubjectAltName Comparison in OpenSSL Backend
Weaknesses CWE-295
CWE-297
References
Metrics cvssV3_1

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


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-20T19:04:42.247Z

Reserved: 2026-06-09T19:11:53.484Z

Link: CVE-2026-53583

cve-icon Vulnrichment

Updated: 2026-08-20T19:02:30.259Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-08-20T19:16:54.500

Modified: 2026-09-09T21:19:49.197

Link: CVE-2026-53583

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-08-20T18:39:03Z

Links: CVE-2026-53583 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-21T02:00:05Z

Weaknesses
  • CWE-295

    Improper Certificate Validation

  • CWE-297

    Improper Validation of Certificate with Host Mismatch