← ALL ADVISORIES

MEDIUM BYTERAY-2026-0370Disclosed

wolfSSL — Chain CA CRL Failures Discarded When OCSP Stapling Is Requested

For a client that requests OCSP stapling, wolfSSL replaces a failed CRL check on a chain CA certificate with success unless the CRL explicitly lists the certificate as revoked. The staple that is expected to cover the certificate is never required, so a missing or stale CRL for an intermediate no longer fails the handshake.

Advisory
BYTERAY-2026-0370
CWE
CWE-370
Vendor
wolfSSL
Product
wolfSSL
Reported
2026-09-28
Disclosure
2026-12-03
Affected
wolfSSL 5.9.2 (tested at master commit d95483f), clients built with HAVE_CRL, HAVE_OCSP and OCSP stapling that enable CRL and OCSP checking for the whole chain and request stapling
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

A wolfSSL client can be configured to check every certificate in the server's chain against a CRL and against OCSP. When that client also requests OCSP stapling, ProcessPeerCerts() marks each chain certificate as waiting for a stapled response. If the CRL check on that certificate then fails for any reason other than an explicit revocation, the error is overwritten with success.

The comment at the override says a staple can still arrive and that one which never does fails open. Nothing later requires the staple. The function that inspects stapled responses is called for the leaf only, and for an intermediate without a response it writes a log message and continues.

A server, or an on-path party in TLS 1.2 static-key suites, that presents a chain under an intermediate whose CRL the client cannot fetch, or holds only in stale form, completes the handshake with no revocation status for that intermediate. The configuration is the strictest one the library offers and is not a default build.

Affected Products and Versions

  • Component: src/internal.c, ProcessPeerCerts(), chain certificate loop.
  • Required build: HAVE_CRL and HAVE_OCSP with HAVE_CERTIFICATE_STATUS_REQUEST (TLS 1.3) or HAVE_CERTIFICATE_STATUS_REQUEST_V2 (TLS 1.2).
  • Required configuration: WOLFSSL_CRL_CHECKALL, WOLFSSL_OCSP_CHECKALL, and stapling requested by the client.
  • Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
  • A default build is not affected. CRL support is disabled by default (configure.ac:9145).
  • Other releases were not checked.

Technical Details

The override is inside the chain CRL block of ProcessPeerCerts() (src/internal.c:18749-18754). When ocspStapleDeferred is set, OCSP is enabled with check-all, and the CRL result is anything other than CRL_CERT_REVOKED, it executes ret = 0. The comment above it reads "A staple for this certificate can still arrive; one that never does fails open."

ocspStapleDeferred is set for every chain certificate of a stapling client: at src/internal.c:18645 for TLS 1.2 status_request_v2 and at src/internal.c:18661 for TLS 1.3 status_request. It reflects the client's own request, not anything the server has sent.

The sequence for one chain certificate:

  1. The chain CRL block is entered when crlEnabled and crlCheckAll are set (src/internal.c:18699-18700).
  2. CheckCertCRL() runs (src/internal.c:18718). With no CRL available for the issuer it returns CRL_MISSING; with an expired CRL it returns CRL_CERT_DATE_ERR.
  3. DoCrlCallback() is called (src/internal.c:18731). Without an application CRL callback it does nothing (src/internal.c:16577-16582).
  4. The override sets ret to 0. Only CRL_CERT_REVOKED survives.
  5. The staple check, ProcessPeerCertsChainOCSPStatusCheck(), is called from leaf processing only (src/internal.c:17528). For an intermediate with no response it logs "Intermediate cert doesn't have certificate status." and returns success (src/internal.c:17233-17235).
  6. ProcessPeerCerts() finishes on its success path and records the peer certificate (src/internal.c:19358).

Without the override, the CRL error would reach the verify callback handling and fail the certificate in a build with no callback installed.

For TLS 1.2 ocsp_multi clients the chain CAs are also held in a pending pool and later merged without a per-CA response requirement. That handler is described in BYTERAY-2026-0368.

Reachability and Preconditions

  • Build with CRL, OCSP and OCSP stapling support.
  • The client calls wolfSSL_EnableCRL with WOLFSSL_CRL_CHECKALL and wolfSSL_EnableOCSP with WOLFSSL_OCSP_CHECKALL, and requests stapling.
  • The attacker is the TLS server, or an on-path party in a TLS 1.2 static-RSA deployment.
  • The chain is otherwise valid: it has a signature path to a trusted root and passes name and validity checks.
  • The CRL for the intermediate is unavailable or stale at the client. An attacker who controls the client's network path can cause this by blocking the CRL fetch.
  • The server sends no staple for the chain certificate. No authentication is required.

Impact

Under a policy that requires revocation checking for every certificate in the chain, the handshake completes with no revocation result for the chain CAs. A chain under a revoked intermediate is accepted whenever the client cannot obtain a current CRL for it. A chain certificate that a fetched, current CRL lists as revoked is still rejected.

ByteRay did not build a proof of concept for this issue. The analysis is from source review.

Remediation and Mitigation

ByteRay has not confirmed a fixed wolfSSL release for this issue as of 2026-12-03, and has not checked it against wolfSSL changes made after the tested commit.

The fix direction is to stop replacing the CRL error unless a staple for that exact chain certificate has been received and verified. If the error is deferred, the deferred check has to cover the whole chain and fail the handshake, or restore the original CRL error, when the staple does not arrive. ocspStapleDeferred should follow a commitment from the server and not the client's request alone. As a workaround, keep current CRLs for the expected intermediates loaded on the client so the chain CRL check has data and does not depend on a fetch. A client that does not request stapling does not set ocspStapleDeferred, and the override does not apply to it.

Timeline

  • 2026-09-28 — Reported to wolfSSL.
  • 2026-12-03 — Public disclosure.

Credits

Discovered and reported by Mehrun P. Hunter and Shahriyar Jalayeri of ByteRay Ltd.

References