---
id: "CVE-2026-87866"
kind: "vulnerability"
aliases: ["CVE-2026-87866"]
title: "curl with wolfSSL: pinned public key check can be bypassed"
severity: "unknown"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["curl", "embedded", "package", "self-hosted", "tls", "wolfssl"]
not_affected_if: ["default-config", "no-public-key-pinning", "openssl-backend"]
published_at: "2026-10-20T21:17:20+00:00"
first_seen_at: "2026-10-23T21:57:21+00:00"
updated_at: "2026-10-25T05:04:25+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-87866", "first_seen_at": "2026-10-23T21:57:21+00:00"}]
---

# curl with wolfSSL: pinned public key check can be bypassed

When curl is built with wolfSSL, a crafted certificate with a manipulated validity length field can make curl's pinned public key check match a key the TLS peer does not hold. An attacker in a position to present a certificate could get curl to accept a connection it should reject.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `curl --version` and look for wolfSSL in the SSL library line
- unknown whether the sources give a vulnerable curl version range

## Timeline

- 2026-10-23T21:57:21+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-87866

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
