← ALL ADVISORIES

LOW BYTERAY-2026-0460Disclosed

wolfSSL — Missing Fatal Alert on Session Resumption Rejection in TLS 1.2 Server

The server-side resumption handler rejects a ClientHello that drops extended master secret or omits the resumed session's cipher suite, but the fatal alerts for those three cases are compiled only with WOLFSSL_EXTRA_ALERTS. A default build ends the handshake without an alert.

Advisory
BYTERAY-2026-0460
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), TLS 1.2 and earlier servers in builds without WOLFSSL_EXTRA_ALERTS, which includes the default configuration
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

When a client asks to resume a session, a wolfSSL server checks the request in HandleTlsResumption(). It refuses the handshake when extended master secret (EMS) is required but not offered, when the stored session used EMS and the new ClientHello does not, and when the cipher suite of the stored session is not in the client's suite list.

Each of the three rejection branches names the fatal alert it should send, handshake_failure or illegal_parameter. In each branch the SendAlert() call is inside #ifdef WOLFSSL_EXTRA_ALERTS. A default build does not define that macro, and the general error-to-alert mapper that runs afterwards is also empty in such a build. The branch sets an error code and nothing is sent.

The server refuses the resumption in every build, so no policy is bypassed. In a default build the client sees the connection stop with no TLS-level reason. Default builds are affected.

Affected Products and Versions

  • Component: src/internal.c, HandleTlsResumption(), called from DoClientHello().
  • 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.
  • Other releases were not checked.

Technical Details

The three branches have the same shape. The first one, at src/internal.c:41596-41603:

        if (ssl->options.requireEMS && !ssl->options.haveEMS) {
            WOLFSSL_MSG("EMS required but not negotiated with peer");
        #ifdef WOLFSSL_EXTRA_ALERTS
            SendAlert(ssl, alert_fatal, handshake_failure);
        #endif
            WOLFSSL_ERROR_VERBOSE(EXT_MASTER_SECRET_NEEDED_E);
            return EXT_MASTER_SECRET_NEEDED_E;
        }

The branches are:

  1. EMS is required by configuration and the ClientHello does not offer it. The gated alert is handshake_failure; the function returns EXT_MASTER_SECRET_NEEDED_E (src/internal.c:41596-41603).
  2. The stored session was established with EMS and the resuming ClientHello does not offer it. The gated alert is handshake_failure; the result is EXT_MASTER_SECRET_NEEDED_E (src/internal.c:41739-41747).
  3. The stored session's cipher suite is not in the ClientHello suite list. The gated alert is illegal_parameter; the result is UNSUPPORTED_SUITE (src/internal.c:41761-41768).

The error then travels up through DoClientHello() to the record layer, which calls SendFatalAlertOnly(). Without WOLFSSL_EXTRA_ALERTS that function is a stub that returns 0 (src/internal.c:21189-21195), so no later step sends an alert either. That stub is described in BYTERAY-2026-0464.

Reachability and Preconditions

  • Build without WOLFSSL_EXTRA_ALERTS.
  • A TLS 1.2 or earlier server with a session cache or session tickets, so that resumption requests are evaluated. Branch 1 also needs the non-default requireEMS option. Branch 3 is active unless NO_RESUME_SUITE_CHECK is defined.
  • The attacker is a remote client. It chooses whether the ClientHello carries the EMS extension, which session it asks to resume and which suites it lists.
  • No authentication is needed. The branches run before the handshake completes.

Impact

A client that sends a non-conforming resumption request has the handshake refused without the handshake_failure or illegal_parameter alert that RFC 5246 calls for. The client sees a truncated connection; a DTLS client keeps retransmitting until it times out. Operators lose the peer-visible reason for the failure. There is no confidentiality or integrity effect. The rejection itself is enforced in every build.

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 fatal alert in all three branches regardless of WOLFSSL_EXTRA_ALERTS, keeping handshake_failure for the two EMS cases and illegal_parameter for the cipher suite mismatch, and keeping the specific error codes for the application. More generally, the error-to-alert mapping should not depend on an opt-in build flag. Workaround: build with WOLFSSL_EXTRA_ALERTS defined, for example through --enable-harden-tls or CFLAGS.

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