Skip to main content
Vulnerability Database/CVE-2026-87866

CVE-2026-87866: curl with wolfSSL Auth Bypass Vulnerability

CVE-2026-87866 is an authentication bypass flaw in curl built with wolfSSL that allows incorrect public key pinning validation. Attackers can exploit certificate parsing to bypass security checks. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-87866 Overview

CVE-2026-87866 affects curl when built with wolfSSL as the TLS backend. The vulnerability allows a malicious TLS peer to pass curl's pinned public key check without actually possessing the pinned key. During the TLS handshake, wolfSSL validates the server certificate correctly. However, curl re-parses the same certificate afterward to extract the public key for pinning comparison. A manipulated validity length field tricks curl's parser into extracting a different embedded key, which then matches the pinned hash and incorrectly authorizes the connection.

Critical Impact

Attackers can defeat curl's --pinnedpubkey protection when wolfSSL is the TLS backend, undermining a defense-in-depth control that applications rely on to prevent man-in-the-middle attacks.

Affected Products

  • curl compiled with wolfSSL as the TLS backend
  • Applications and libraries using libcurl with wolfSSL that rely on public key pinning
  • Embedded and IoT deployments that commonly pair curl with wolfSSL

Discovery Timeline

  • 2026-10-20 - CVE-2026-87866 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-87866

Vulnerability Analysis

The flaw is a certificate validation bypass that targets curl's public key pinning feature rather than the underlying TLS trust chain. wolfSSL performs standard certificate verification during the handshake and correctly validates the peer. curl then independently parses the leaf certificate a second time to extract the Subject Public Key Info (SPKI) for hashing against the user-supplied pin.

The two parsers disagree. By crafting a certificate with a manipulated validity length field, an attacker can shift curl's internal parsing offset so that curl extracts a different embedded key from the same certificate structure. The extracted key hash matches the pinned value, and curl treats the connection as authorized. Full details are available in the cURL CVE-2026-87866 Advisory and HackerOne Report #3989514.

Root Cause

The root cause is parser differential behavior between wolfSSL's certificate handling and curl's SPKI extraction logic. curl's parser mishandles the ASN.1 validity length field, causing field boundaries to shift. This classifies as [Improper Certificate Validation] in curl's post-handshake pinning path. The TLS stack itself is not bypassed, but the pinning defense built on top of it is.

Attack Vector

An attacker who can intercept TLS connections, for example on a hostile network or via a compromised upstream, presents a crafted certificate that still passes wolfSSL's chain validation. The certificate embeds the real target's public key in a location that curl's offset-shifted parser reads. The attacker holds a different private key than the one that curl ultimately hashes. The pinned-key check passes and the connection proceeds, allowing interception of application traffic that assumed pinning provided assurance of peer identity.

No verified public exploit code is available at this time. Refer to the linked advisory for reproduction details.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-87866

Indicators of Compromise

  • curl or libcurl binaries linked against wolfSSL on affected versions, identified via curl -V output showing wolfSSL in the TLS backend field
  • TLS sessions where the presented certificate contains anomalous ASN.1 length encodings or multiple embedded public key structures
  • Unexpected successful connections to hosts where public key pinning was expected to fail

Detection Strategies

  • Inventory all systems and container images that ship curl or libcurl built with wolfSSL and compare against the fixed version listed in the vendor advisory
  • Hunt for processes invoking curl with --pinnedpubkey or applications calling CURLOPT_PINNEDPUBLICKEY and correlate with the TLS backend in use
  • Capture and inspect peer certificates on sensitive egress paths for malformed validity fields or duplicate SPKI structures

Monitoring Recommendations

  • Log and alert on outbound TLS connections from systems using curl with wolfSSL to untrusted or newly observed destinations
  • Monitor software bill of materials (SBOM) feeds for curl and wolfSSL version changes across production and embedded fleets
  • Track changes to certificates presented by critical API endpoints and flag unusual ASN.1 structure patterns

How to Mitigate CVE-2026-87866

Immediate Actions Required

  • Identify all curl and libcurl deployments built against wolfSSL using package inventories and curl -V
  • Upgrade curl to the fixed version identified in the cURL CVE-2026-87866 Advisory
  • Re-verify that applications depending on CURLOPT_PINNEDPUBLICKEY continue to behave correctly after the upgrade
  • Rotate pinned keys if there is evidence that the pinning check may have been bypassed in production traffic

Patch Information

Refer to the cURL CVE-2026-87866 Advisory and the machine-readable cURL CVE-2026-87866 JSON Data for the authoritative list of affected versions and the fixed release. Rebuild any statically linked binaries and container images that embed libcurl once the patched version is available in your build pipeline.

Workarounds

  • Rebuild curl against a different TLS backend such as OpenSSL where the parsing differential does not apply, if a patched release cannot be deployed immediately
  • Disable reliance on --pinnedpubkey and CURLOPT_PINNEDPUBLICKEY as the sole peer authentication control until the patched build is in place
  • Enforce certificate validation through a strict internal certificate authority and short-lived certificates to reduce the window of exposure
bash
# Verify the TLS backend used by your curl installation
curl -V | tr ' ' '\n' | grep -i -E 'wolfssl|openssl|gnutls|mbedtls'

# Example: confirm the installed curl version against the vendor advisory
curl --version | head -n 1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.