← ALL ADVISORIES

MEDIUM BYTERAY-2026-0363Disclosed

wolfSSL — Missing Destination Validation for Certificate-Supplied CRL Distribution Point Fetches

With inline CRL fetching enabled, wolfSSL sends an HTTP GET to the host and port named in a certificate's CRL distribution point and applies no check to the destination. A certificate that the verifier accepts can direct that request at loopback, link-local or private addresses reachable from the verifier.

Advisory
BYTERAY-2026-0363
CWE
CWE-180
Vendor
wolfSSL
Product
wolfSSL
Reported
2026-09-28
Disclosure
2026-12-03
Affected
wolfSSL 5.9.2 through 5.9.4, builds with HAVE_CRL and HAVE_CRL_IO (--enable-crl=io) using the default CRL lookup callback
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

Builds with --enable-crl=io can download a CRL during certificate verification. When no current CRL for the certificate's issuer is loaded, wolfSSL takes the URL from the certificate's CRL distribution point extension, connects to the host and port in it, and sends a GET request.

Nothing restricts where that request goes. The URL parser accepts any host name, any IPv4 or bracketed IPv6 literal, and any port. The OCSP lookup in the same file has an optional destination screen for loopback and private ranges; the CRL lookup has none, under any build option.

A party who can present a certificate that passes chain verification, and who chose its distribution point, can make the verifier issue a GET to an internal address such as 169.254.169.254 or 127.0.0.1 on a chosen port. The response is only parsed as a CRL, so the request is blind. Inline CRL fetching is not part of a default build.

Affected Products and Versions

  • Component: src/wolfio.c, EmbedCrlLookup(), the default CRL I/O callback.
  • Required build: HAVE_CRL and HAVE_CRL_IO. --enable-crl=io sets both (configure.ac:9159-9166); --enable-all also sets HAVE_CRL_IO (configure.ac:1449). CRL support is off by default (configure.ac:9144-9148).
  • Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
  • The v5.9.2-stable and v5.9.4-stable tags contain the same function with no destination check. Not fixed on master.
  • A default ./configure build does not include this code. Earlier releases were not checked.

Technical Details

EmbedCrlLookup() decodes the URL into a host and a port with wolfIO_DecodeUrl() (src/wolfio.c:2616), allocates a buffer, builds the request (src/wolfio.c:2627-2628) and connects (src/wolfio.c:2630-2636):

            if (httpBufSz <= 0) {
                WOLFSSL_MSG("Unable to build CRL request");
            }
            else if ((ret = wolfIO_TcpConnect(&sfd, domainName, port,
                                              io_timeout_sec)) != 0) {
                WOLFSSL_MSG("CRL connection failed");
            }

There is no step between decoding the URL and connecting. wolfIO_DecodeUrl() checks syntax only: it rejects CR and LF, an unterminated IPv6 bracket and a malformed or out-of-range port (src/wolfio.c:1686). It places no restriction on the host.

How the URL arrives:

  1. The certificate parser stores the URI from the CRL distribution point extension in cert->extCrlInfo (wolfcrypt/src/asn.c:21134-21138).
  2. CheckCertCRL() passes that pointer and its length on (src/crl.c:706-715).
  3. When no current CRL for the issuer is found, the CRL code calls the I/O callback with it (src/crl.c:622-627).
  4. The callback is EmbedCrlLookup() whenever CRL checking is enabled on the certificate manager and the default I/O layer is in use (src/ssl_certman.c:1816-1821, src/ssl_certman.c:1833-1838).
  5. EmbedCrlLookup() connects and sends GET <url> HTTP/1.1 with a Host header (src/wolfio.c:2570-2576, src/wolfio.c:2633-2637).
  6. The response is accepted only with a CRL content type and is then loaded as a CRL (src/wolfio.c:2584-2594).

For comparison, EmbedOcspLookup() calls wolfIO_OcspDestAllowed() before it connects when WOLFSSL_OCSP_SCREEN_RESPONDER is defined (src/wolfio.c:2506-2513). That screen is opt-in and has its own limits, described in BYTERAY-2026-0364. The CRL path has no counterpart.

Reachability and Preconditions

  • Build with HAVE_CRL and HAVE_CRL_IO, and CRL checking enabled at run time (wolfSSL_CTX_EnableCRL or the certificate manager equivalent). The verifier has no verified, unexpired CRL loaded for the issuer of the certificate being checked (src/crl.c:574-575). A current CRL for that issuer prevents the fetch.
  • The CRL check runs only after the certificate has passed chain verification (src/internal.c:19258-19259, src/internal.c:17589-17592; chain certificates at src/internal.c:18716-18719). The attacker therefore needs a certificate the verifier accepts whose distribution point they chose. Publicly trusted CAs set that field themselves. The realistic cases are a private CA that copies requested extensions, a CA the attacker operates that the verifier trusts, or a verifier that does not verify the chain but leaves CRL checking on (src/internal.c:18989-18991).
  • The attacker presents the certificate as a TLS peer, client or server. No user interaction is needed.

Impact

Confirmed from source: under the preconditions above, the verifier opens a TCP connection to an attacker-named host and port and sends an HTTP GET whose request target is the attacker-supplied URL. The destination can be loopback, link-local or private.

The attacker does not receive the response. It is consumed by the CRL loader, and a body that is not a CRL is dropped. What the attacker can observe is limited to the verification outcome and its timing. What the GET does to an internal service depends on the service and was not assessed. Fetching the distribution point named in the certificate is what this feature is for. The gap is that no destination policy exists and none can be switched on.

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

Remediation and Mitigation

Not fixed on wolfSSL master as of commit e4b0841b32e7 (2026-12-03).

The fix direction is a destination check in EmbedCrlLookup() equivalent to the OCSP screen, applied to the address that is actually connected to, with a way for deployments to allow internal distribution points on purpose.

Workarounds: build with --enable-crl without =io and load CRLs out of band; or register an application CRL I/O callback with wolfSSL_SetCRL_IOCb or wolfSSL_CertManagerSetCRL_IOCb that enforces a destination policy. Egress filtering on the verifying host also limits what the request can reach. The first option gives up automatic CRL download.

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