08: CVE-2026-7009 fix incomplete for AWS-LC: `--cert-status` bypass on SecTrust path
The fix for an earlier curl OCSP-stapling bug did not cover builds using AWS-LC as the TLS backend, because AWS-LC signals a missing OCSP response differently from OpenSSL. On such builds, curl with --cert-status could accept a certificate chain with no stapled OCSP response instead of rejecting it.
Originally disclosed on HackerOne
- Disclosed after 12 days
Summary
The fix for CVE-2026-7009 (commit 51905671e0) does not cover AWS-LC. In ossl_apple_verify() in lib/vtls/openssl.c, a missing OCSP staple is detected only when SSL_get_tlsext_status_ocsp_resp() returns a negative length. OpenSSL returns -1 for absence, but AWS-LC returns 0 with a NULL output pointer. On an AWS-LC + USE_APPLE_SECTRUST build, --cert-status silently accepts a certificate chain with no stapled OCSP response instead of failing with CURLE_SSL_INVALIDCERTSTATUS (91).
Root cause
ossl_apple_verify() in lib/vtls/openssl.c (lines 4752–4762):
long ocsp_len = 0;
bool ocsp_missing = FALSE;
if(conn_config->verifystatus && !octx->reused_session)
ocsp_len = (long)SSL_get_tlsext_status_ocsp_resp(octx->ssl, &ocsp_data);
if(ocsp_len < 0) {
ocsp_len = 0;
ocsp_missing = TRUE;
}
AWS-LC declares SSL_get_tlsext_status_ocsp_resp as returning size_t. Its header (include/openssl/ssl.h) documents: "If there was no response, it sets |*out| to NULL and returns zero." The cast (long)0 is not < 0, so ocsp_missing stays FALSE.
The fallback verifystatus() check later in Curl_ossl_check_peer_cert() is also skipped because it is gated behind !octx->sectrust_verified (lines 4864–4868). Both layers of OCSP enforcement are bypassed.
Affected configuration
- curl built with AWS-LC as the OpenSSL backend (
HAVE_BORINGSSL_LIKE) USE_APPLE_SECTRUST=ON(macOS, off by default)--cert-status/CURLOPT_SSL_VERIFYSTATUSenabled- Fresh (non-reused) TLS session
- Server sends no OCSP staple
The CVE-2026-7009 advisory lists curl 8.20.0+ as unaffected and includes AWS-LC among affected backends, so the affected range may need revisiting.
Reproduction
- Use curl 8.20.0 or 8.21.0 on macOS and build it against a current AWS-LC release with
CURL_USE_OPENSSL=ONandUSE_APPLE_SECTRUST=ON. - Confirm that the resulting binary reports both AWS-LC as its TLS backend and Apple SecTrust support.
- Prepare an HTTPS test server with a hostname-valid certificate chain that Apple SecTrust accepts. A private test CA may be installed in a dedicated test keychain for this purpose.
- Configure the server not to send a stapled OCSP response. Independently verify the absence of the TLS Certificate Status response with a TLS diagnostic client.
- Ensure the test uses a fresh TLS connection without session resumption, because the affected check is performed for a non-reused session.
- Connect with the AWS-LC-backed curl using the native CA store and require OCSP stapling with
--cert-statusorCURLOPT_SSL_VERIFYSTATUS. - Instrument
ossl_apple_verify()or inspect it in a debugger and confirm that AWS-LC'sSSL_get_tlsext_status_ocsp_resp()returns length zero and sets the response pointer toNULL. - Confirm that the affected condition checks only for a negative length, leaving
ocsp_missingfalse for AWS-LC's zero-length result. - Observe the vulnerable result: Apple SecTrust accepts the otherwise trusted certificate chain and curl completes the transfer successfully despite the required OCSP staple being absent.
- Change the missing-response test so that a non-positive length is treated as missing, rebuild curl, and repeat the request.
- Observe the expected result: curl rejects the connection with
CURLE_SSL_INVALIDCERTSTATUSand reports that no OCSP response was received. - As a regression control, configure the server to provide a valid, nonempty OCSP staple and repeat the request with the corrected build. Confirm that the valid response is still passed to SecTrust and the transfer succeeds.
- Alternatively, verify the upstream correction by testing a revision containing commit
c878bb36f8; the no-staple case must fail while the valid-staple case continues to work.
Expected result
When OCSP stapling is explicitly required, the absence of a response must terminate the connection with CURLE_SSL_INVALIDCERTSTATUS, regardless of the OpenSSL-compatible backend's return-value convention.
Vulnerable result
AWS-LC reports an absent response as (0, NULL), but curl checks only for a negative length. SecTrust can therefore accept the certificate chain and curl can complete the transfer without the required OCSP status.
Suggested fix
if(ocsp_len <= 0 || !ocsp_data) {
ocsp_len = 0;
ocsp_missing = TRUE;
}
This covers OpenSSL's -1 convention, AWS-LC's 0 + NULL convention, and any future backend that may signal absence differently.
Impact
Summary:
An attacker possessing a hostname-valid certificate and private key that SecTrust accepts—such as a revoked certificate whose status is not otherwise known locally—could impersonate the target without providing the required OCSP staple. This can enable interception or modification of TLS-protected traffic despite the client explicitly requesting certificate-status verification.
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 code treats only a negative length from SSL_get_tlsext_status_ocsp_resp() as a missing OCSP response, but AWS-LC returns zero with a NULL pointer for absence, so the missing-response flag is never set.
Impact
An attacker with a hostname-valid certificate and key that SecTrust accepts, such as a revoked certificate, could impersonate the target without providing the required OCSP staple, potentially enabling interception or modification of TLS traffic; this only applies to the specific AWS-LC plus Apple SecTrust build configuration.
What the attacker needed
Curl built with AWS-LC backend; USE_APPLE_SECTRUST enabled (macOS); --cert-status requested; fresh TLS session
The fix
The missing-response check should treat a non-positive length or a NULL response pointer as a missing staple; the text suggests this fix and mentions testing commit c878bb36f8.
How it was found
- Build curl on macOS against AWS-LC with OpenSSL and Apple SecTrust support enabled.
- Confirm the binary uses AWS-LC and Apple SecTrust.
- Set up an HTTPS test server with a SecTrust-accepted chain and no stapled OCSP response, verified with a TLS diagnostic client.
- Use a fresh TLS connection without session resumption.
- Connect with --cert-status or CURLOPT_SSL_VERIFYSTATUS using the native CA store.
- Observe that the transfer succeeds despite the missing staple, then rebuild with a non-positive length treated as missing and confirm rejection.
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.
OCSP stapling is a way for a server to attach a fresh 'this certificate is not revoked' note to its TLS handshake. When a client asks for that note with --cert-status, it should refuse to continue if the note is missing. Here, on one particular TLS library, curl failed to notice the note was absent and carried on anyway.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.