# CVE-2026-53583: libgit2: Inverted IP SubjectAltName Comparison in OpenSSL Backend

> A logic error in libgit2's OpenSSL backend allows attackers to bypass IP-based certificate validation, enabling man-in-the-middle attacks on IP-literal HTTPS connections.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Aug 2026
- **Updated:** 20 Aug 2026
- **Also known as:** AZL-96971, BELL-CVE-2026-53583, DEBIAN-CVE-2026-53583, ECHO-417b-96b7-cd13, GHSA-h7gc-w2gg-p9xp, JLSEC-2026-1369, MINI-643c-c97m-wfmq, UBUNTU-CVE-2026-53583, USN-8907-1

## What is CVE-2026-53583?

CVE-2026-53583 is a medium-severity vulnerability in libgit2, published on 20 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-297 (Improper Validation of Certificate with Host Mismatch), CWE-295 (Improper Certificate Validation)

## Which versions are affected by CVE-2026-53583?


## How do I fix CVE-2026-53583?

Upgrade to a fixed version.

## Is CVE-2026-53583 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-53583 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-53583 and fix it if it is affected.

What it is: CVE-2026-53583 is a medium-severity vulnerability in libgit2, published on 20 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-53583 exists.

Affected product: libgit2. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-53583/ (Markdown: https://insights.sbomify.com/CVE-2026-53583/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-53583
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-53583
- OSV: https://osv.dev/vulnerability/CVE-2026-53583

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-53583/
Summaries are generated and may contain mistakes; the official description above is the record.
