Skip to content
Crypto Disclosed report Advanced CVE-2026-80230

CVE-2026-80230: OpenSSL pinning bypass

A logic flaw in libcurl's OpenSSL backend causes the public-key pin check to be skipped when the server presents no certificate and the client has disabled certificate verification. An active man-in-the-middle who can force an anonymous cipher suite can then intercept traffic despite the client having configured a pin.

giant_anteater Follow

Originally disclosed on HackerOne

Informational View original
  • Triaged in 2 hours
  • Fixed in 8 days
  • Disclosed after 8 days

Summary

Curl_ossl_check_peer_cert() (line 4795) calls SSL_get1_peer_certificate(). When no peer certificate is available — as with anonymous cipher suites like AECDH-AES128-SHA — the function returns NULL. The subsequent guard at lines 4798–4799 checks !(conn_config->verifypeer || conn_config->verifyhost); when both are disabled (--insecure), it executes goto out, jumping past ossl_check_pinned_key() at line 4874 and returning CURLE_OK.

This means a user who specifies --insecure --pinnedpubkey <hash> expects certificate verification to be relaxed but public-key pinning to remain enforced. Instead, the pin check is silently skipped when the server presents no certificate.

Preconditions

  • libcurl built with OpenSSL
  • Client sets --insecure (or CURLOPT_SSL_VERIFYPEER=0, CURLOPT_SSL_VERIFYHOST=0)
  • Client sets --pinnedpubkey with a specific hash
  • Client allows an anonymous cipher suite (e.g. --ciphers AECDH-AES128-SHA:@SECLEVEL=0)
  • TLS version ≤ 1.2 (--tls-max 1.2) — TLS 1.3 does not support anonymous authentication
  • Server configured with matching anonymous cipher (no certificate loaded)

Reproduction

The PoC (poc.py) starts a Python TLS server with AECDH-AES128-SHA (no certificate), then invokes:

Shell
/opt/curl/bin/curl --insecure \
  --pinnedpubkey "sha256//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" \
  --ciphers "AECDH-AES128-SHA:@SECLEVEL=0" \
  --tls-max 1.2 \
  https://127.0.0.1:PORT/

Success criterion: curl exits 0 and receives the HTTP response. Expected behavior: CURLE_SSL_PINNEDPUBKEYNOTMATCH (exit 90).

Negative control: Same wrong pin against a server with a real certificate → curl exits 90. This confirms the pin check functions when a certificate is present.

Root cause trace

  1. Client connects with --insecure and --pinnedpubkey <hash>, negotiating an anonymous cipher.
  2. Curl_ossl_check_peer_cert() calls SSL_get1_peer_certificate(octx->ssl) → returns NULL (line 4795).
  3. Guard at line 4798: !(conn_config->verifypeer || conn_config->verifyhost) → TRUE because --insecure disables both.
  4. goto out (line 4799) jumps to line 4876, skipping ossl_check_pinned_key() at line 4874.
  5. result is still CURLE_OK → function returns success.
  6. curl completes the transfer without checking the public-key pin.

Remediation

Before the goto out at line 4799, check whether pinned_key is set. If a pin is configured but no certificate is available to verify it against, return CURLE_SSL_PINNEDPUBKEYNOTMATCH instead of silently succeeding. Alternatively, restructure the function to always reach ossl_check_pinned_key() when pinned_key is non-NULL, regardless of the verifypeer/verifyhost state.

Impact

An active MITM attacker who controls the network can force negotiation of an anonymous cipher (if the client allows it via --ciphers) and intercept traffic even though the client specified a public-key pin. The attack requires the client to use --insecure (or CURLOPT_SSL_VERIFYPEER=0) together with --pinnedpubkey, and the client must allow an anonymous cipher suite. While --insecure already weakens security, users who combine it with pinning rely on the pin as their sole authentication — this bypass removes that guarantee.

The original report as published on HackerOne, by giant_anteater. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely an early exit for the no-certificate case runs before the pin comparison, so a configured pin is never checked when verification is disabled and no peer certificate exists.

Impact

An active man-in-the-middle who controls the network could intercept traffic when the client uses --insecure together with a pin and permits an anonymous cipher suite, removing the pin as the sole authentication guarantee.

What the attacker needed

Libcurl built with OpenSSL; client uses --insecure; client sets --pinnedpubkey; client allows an anonymous cipher suite

The fix

The function should check whether a pin is configured before the early exit and return a pin-mismatch error when no certificate is available, or always reach the pin check when a pin is set.

How it was found

  1. Start a TLS server that uses an anonymous cipher suite and loads no certificate.
  2. Run curl with certificate verification disabled, a pinned public key hash, the anonymous cipher allowed, and TLS capped at 1.2.
  3. Observe that curl exits successfully and receives the response instead of reporting a pin mismatch.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Public-key pinning is a way for a program to remember exactly which key a server should use, so even a fake certificate cannot fool it. Here, if the user also turned off normal certificate checking and the server sent no certificate at all, the program forgot to compare the key and accepted the connection. Someone sitting on the network could then pretend to be the server and read the traffic.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by giant_anteater

View all

93 more disclosed reports, best first.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.