# CVE-2026-87866: wolfSSL public-key pinning bypass


- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 20 Oct 2026
- **Updated:** 29 Oct 2026
- **Also known as:** ALPINE-CVE-2026-87866, AZL-109920, AZL-109953, AZL-110028, AZL-110133, AZL-110211, AZL-110286, CURL-CVE-2026-87866, DEBIAN-CVE-2026-87866, ECHO-354c-d2e4-dde2, GHSA-wq9f-qmpx-2cc8, MINI-3vxq-w992-mxw9

## What is CVE-2026-87866?

CVE-2026-87866 is a critical vulnerability in curl, published on 20 Oct 2026. 

### Official description

When built with wolfSSL, curl can successfully validate a pinned public key
hash against a key the TLS peer does not possess. During the TLS handshake,
wolfSSL validates the connection, but curl's subsequent re-parsing of the same
certificate - tricked by a manipulated validity length field - extracts and
matches a different embedded key, incorrectly authorizing the pinned public
key.

Weakness: CWE-295 (Improper Certificate Validation)

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


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

Upgrade to a fixed version.

## Is CVE-2026-87866 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-87866 is a critical vulnerability in curl, published on 20 Oct 2026. 
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-87866 exists.

Affected product: curl. 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-87866/ (Markdown: https://insights.sbomify.com/CVE-2026-87866/index.md)
```

## Sources

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

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