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

CVE-2026-80231: native CA store conn reuse

On macOS, curl's connection-reuse matching ignored the native_ca_store flag, so a transfer meant to use SecTrust could reuse an OpenSSL-only verified connection, letting a certificate trusted under one policy but not the other pass without re-checking.

giant_anteater Follow

Originally disclosed on HackerOne

  • Triaged in 2 hours
  • Fixed in 8 days
  • Disclosed after 8 days

Summary

native_ca_store is in struct ssl_config_data (line 73 of vtls_config.h), not ssl_primary_config. match_ssl_primary_config() does not compare it. On macOS, Curl_ssl_easy_config_complete() (line 258) auto-sets native_ca_store = TRUE when no custom CA is configured — without modifying ssl_options. When CURL_CA_BUNDLE is defined, the auto-fill gives both transfers the same primary.CAfile, making all primary config fields match while native_ca_store differs.

Transfer A (explicit CURLOPT_CAINFO = CURL_CA_BUNDLE path): custom_cafile=TRUE, auto-setting prevented, native_ca_store=FALSE — OpenSSL-only verification.

Transfer B (no CURLOPT_CAINFO): auto-fill sets same CAfile, custom_cafile=FALSE, auto native_ca_store=TRUE — intended SecTrust verification.

match_ssl_primary_config sees matching CAfile + ssl_options → connection reused. B inherits A's connection without SecTrust ever running.

Reproduction

macOS baremetal (poc-native-ca.c), built with -DUSE_APPLE_SECTRUST=ON -DCURL_CA_BUNDLE=<path> -DCURL_USE_OPENSSL=ON:

  1. Transfer A: explicit CURLOPT_CAINFO = CURL_CA_BUNDLE path → OpenSSL verifies
  2. Transfer B: no CAINFO → auto-fill, auto native_ca_store=TRUE → should use SecTrust
  3. Observe: "Reusing existing https: connection" — SecTrust never runs

Root cause trace

  1. Curl_ssl_easy_config_complete() (line 258): !custom_capath && !custom_cafile && !custom_cablob → native_ca_store = TRUE. Does NOT modify ssl_options.
  2. CURL_CA_BUNDLE auto-fill (line 269): sets STRING_SSL_CAFILE → primary.CAfile = bundle path.
  3. Transfer A explicitly sets CURLOPT_CAINFO to the same path → custom_cafile=TRUE, auto-setting prevented, native_ca_store=FALSE. Same primary.CAfile, same ssl_options=0.
  4. match_ssl_primary_config matches all fields → connection reused. native_ca_store not compared.

Remediation

Move native_ca_store into ssl_primary_config so match_ssl_primary_config() compares it. Or add an explicit check in Curl_ssl_conn_config_match().

Impact

A transfer expecting SecTrust verification silently inherits an OpenSSL-only verified connection (or vice versa). Certificates trusted by one policy but not the other pass without re-verification.

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

The native_ca_store field lives outside ssl_primary_config, so match_ssl_primary_config() never compares it when deciding whether a connection can be reused.

Impact

A transfer expecting SecTrust verification could silently inherit an OpenSSL-only verified connection, so certificates trusted by one policy but not the other pass without re-verification.

What the attacker needed

MacOS build with SecTrust and OpenSSL; CURL_CA_BUNDLE defined at build time; two transfers to the same host

The fix

The text proposes moving native_ca_store into ssl_primary_config so the match function compares it, or adding an explicit check in Curl_ssl_conn_config_match().

How it was found

  1. Build curl on macOS with SecTrust and OpenSSL enabled and a CA bundle path defined.
  2. Make transfer A with an explicit CAINFO option pointing at the CA bundle path, so OpenSSL verifies.
  3. Make transfer B without CAINFO, so the native CA store is auto-enabled and SecTrust should verify.
  4. Observe that the connection is reused and SecTrust never runs.

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.

When curl makes several requests to the same server, it reuses the existing connection to save time. Before reusing, it checks that the security settings of the two requests match. Here one setting (whether to use the operating system's certificate check on macOS) was left out of that comparison, so a request expecting the stricter check silently got a connection checked a different way.

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.