← ALL ADVISORIES

LOW BYTERAY-2026-0453Disclosed

wolfSSL — Missing Fatal Alert on CertificateVerify Failure in TLS 1.2 Server

DoCertificateVerify maps its failures to decode_error, decrypt_error or bad_certificate alerts only when WOLFSSL_EXTRA_ALERTS is defined. In a default build a server that rejects a client's CertificateVerify closes the connection without sending any alert.

Advisory
BYTERAY-2026-0453
CWE
CWE-544
CVSS
3.7 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L)
Vendor
wolfSSL
Product
wolfSSL
Reported
2026-09-28
Disclosure
2026-12-03
Affected
wolfSSL 5.9.2 (tested at master commit d95483f), servers that request client certificates, in builds without WOLFSSL_EXTRA_ALERTS, which includes the default configuration
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

In a TLS 1.2 handshake with client authentication, the client proves possession of its private key with a CertificateVerify message. The wolfSSL server handles it in DoCertificateVerify(). When the message is malformed or the signature does not verify, the handshake fails.

At its exit the function translates the error into a fatal alert: decode_error for a malformed message, decrypt_error for a failed signature, bad_certificate for anything else. The whole translation is inside #ifdef WOLFSSL_EXTRA_ALERTS. A default build does not define that macro, so no alert is sent for any CertificateVerify failure.

The handshake is still rejected. This is not an authentication bypass. The client, and anyone monitoring the connection, sees the handshake stop with no TLS-level reason. Default builds are affected.

Affected Products and Versions

  • Component: src/internal.c, DoCertificateVerify(), the server-side handler for the client's CertificateVerify in TLS 1.2 and earlier.
  • Required build: any build that does not define WOLFSSL_EXTRA_ALERTS. The macro is defined by --enable-harden-tls (configure.ac:393) and by OpenSSL compatibility builds (wolfssl/wolfcrypt/settings.h:4727-4735). Those builds send the alerts.
  • Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
  • A default ./configure build is affected when the server requests a client certificate. Other releases were not checked.

Technical Details

Every error path in DoCertificateVerify() jumps to the exit_dcv label (src/internal.c:43045). The alert mapping follows it at src/internal.c:43059-43066:

    #ifdef WOLFSSL_EXTRA_ALERTS
        if (ret == WC_NO_ERR_TRACE(BUFFER_ERROR))
            SendAlert(ssl, alert_fatal, decode_error);
        else if (ret == WC_NO_ERR_TRACE(SIG_VERIFY_E))
            SendAlert(ssl, alert_fatal, decrypt_error);
        else if (ret != 0)
            SendAlert(ssl, alert_fatal, bad_certificate);
    #endif
  1. A client sends a certificate and then a CertificateVerify whose signature was made with a key that does not match the certificate, or whose encoding is truncated.
  2. DoCertificateVerify() fails with SIG_VERIFY_E or BUFFER_ERROR and reaches exit_dcv.
  3. Without WOLFSSL_EXTRA_ALERTS the three SendAlert() calls are not compiled. The function returns the error.
  4. The caller's general fallback does not help. DoProcessReplyEx() calls SendFatalAlertOnly() on handshake errors (src/internal.c:26287), and without WOLFSSL_EXTRA_ALERTS that function is an empty stub that returns 0 (src/internal.c:21189-21195).
  5. The handshake is abandoned with nothing sent to the client.

The general fallback is described in BYTERAY-2026-0464. This advisory covers the CertificateVerify exit, where the specific alerts for a failed client authentication are selected.

Reachability and Preconditions

  • Build without WOLFSSL_EXTRA_ALERTS.
  • wolfSSL acts as a server and requests a client certificate, so that CertificateVerify is processed. The handler covers TLS 1.2 and earlier.
  • The attacker is a remote client. It needs a certificate to present and then sends a CertificateVerify that fails. No valid credentials are required.
  • The trigger is deterministic.

Impact

A failed client authentication ends without the alert that tells the client what went wrong. A client with a mismatched key and a client cut off by the network look the same on the wire, which makes client-side diagnosis, interoperability testing and monitoring harder. Behavior also differs between build configurations for identical input. Authentication is not weakened, and confidentiality and integrity are not affected.

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 send the decode_error, decrypt_error and bad_certificate alerts at the exit_dcv label in every build, or to route the error through a central alert mapper that is active in default builds. A regression test on the default configuration, with a CertificateVerify signed by a mismatched key, would keep the behavior identical across builds. Workaround: build with WOLFSSL_EXTRA_ALERTS defined, for example with CPPFLAGS=-DWOLFSSL_EXTRA_ALERTS.

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