wolfSSL — Missing Fatal Alert on Malformed ClientHello Compression Methods in TLS 1.2 Server
The server rejects a ClientHello whose compression methods list is empty, lacks the null method or matches nothing usable, 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-0461
- 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
A TLS 1.2 ClientHello carries a list of compression methods. A wolfSSL server validates that list while it parses the ClientHello. It rejects an empty list, a list without the mandatory null method, and a list that has nothing in common with the server configuration.
Each rejection branch names the alert it should send: decode_error for the empty list and illegal_parameter for the other two. In each branch the SendAlert() call is inside #ifdef WOLFSSL_EXTRA_ALERTS. A default build does not define that macro, so the branch sets COMPRESSION_ERROR and nothing is sent.
The server rejects the ClientHello in every build. In a default build the client sees the connection close with no TLS-level reason. Default builds are affected.
Affected Products and Versions
- Component:
src/internal.c, the compression methods check in the server's ClientHello parser,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
./configurebuild is affected. - Other releases were not checked.
Technical Details
The length byte of the list is read from the ClientHello and bounds-checked at src/internal.c:42245-42250. The first rejection follows at src/internal.c:42252-42259:
if (b == 0) {
WOLFSSL_MSG("No compression types in list");
#ifdef WOLFSSL_EXTRA_ALERTS
SendAlert(ssl, alert_fatal, decode_error);
#endif
ret = COMPRESSION_ERROR;
goto out;
}
The three branches are:
- Empty list (
b == 0). The gated alert isdecode_error; the result isCOMPRESSION_ERROR(src/internal.c:42252-42259). - No null compression method in the list (
!matchNo). The gated alert isillegal_parameter; the result isCOMPRESSION_ERROR(src/internal.c:42277-42284). - No entry usable with the server configuration. The gated alert is
illegal_parameter; the result isCOMPRESSION_ERROR(src/internal.c:42293-42299).
The alert names in the source are the ones RFC 5246 assigns to these conditions. The only gap is the compile-time gate. The error is returned to the record layer, where SendFatalAlertOnly() is a stub without WOLFSSL_EXTRA_ALERTS (src/internal.c:21189-21195), so no later step sends an alert. That stub is described in BYTERAY-2026-0464.
Reachability and Preconditions
- Build without
WOLFSSL_EXTRA_ALERTS. - A TLS 1.2 or earlier server reachable over the network. No server option is needed for branches 1 and 2. Branch 3 needs compression enabled on the server.
- The attacker is a remote client. The compression methods field is fully under its control.
- No authentication is needed. The check runs on the first handshake message.
Impact
A client that sends a malformed compression methods list has the handshake refused without the decode_error or illegal_parameter alert that RFC 5246 calls for. The client, and an operator debugging the connection, cannot tell the rejection from a network fault. There is no confidentiality or integrity effect. The malformed ClientHello is rejected 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 move the three SendAlert() calls out of the WOLFSSL_EXTRA_ALERTS blocks so that a rejected compression methods field always produces the alert before COMPRESSION_ERROR is returned. Tests that connect to a default-configuration server with each malformed input and expect the alert would keep the behavior in place. 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.