← ALL ADVISORIES

LOW BYTERAY-2026-0463Disclosed

wolfSSL — Alert History Recorded Before Delivery Suppresses Later Fatal Alerts

SendAlert_ex writes the alert history before the alert is flushed and does not revert it when the flush fails. The duplicate-alert guards in the TLS 1.3 handshake dispatcher and in DoServerHello then read a fatal alert as already sent and skip every later alert on the connection.

Advisory
BYTERAY-2026-0463
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), all builds with TLS 1.3; connections on non-blocking sockets whose send path returns WANT_WRITE while a fatal alert is flushed
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

wolfSSL records the last alert it transmitted in ssl->alert_history.last_tx. Two error-handling paths, the TLS 1.3 handshake message dispatcher and the TLS 1.3 branch of DoServerHello(), read that record so they do not send a second fatal alert when one has already gone out.

SendAlert_ex() writes the record before it calls SendBuffered(). If the flush fails with WANT_WRITE, the alert is not delivered and its retry marker is cleared, but the history still says a fatal alert was sent. Each later error on the same connection reaches a guard that trusts the history and sends nothing.

A single lost alert therefore becomes a teardown with no alert at all. The trigger is a socket timing condition that a peer can encourage but not control exactly, and the effect is limited to missing error signalling. No build option is involved, so default builds are affected.

Affected Products and Versions

  • Component: src/internal.c, SendAlert_ex(), which writes the history; DoTls13HandShakeMsgType() in src/tls13.c and DoServerHello() in src/internal.c, which read it.
  • Required build: none beyond TLS 1.3 support.
  • Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
  • A default ./configure build is affected when the application uses non-blocking sockets.
  • Other releases were not checked.

Technical Details

The history write in SendAlert_ex() at src/internal.c:30151-30152 comes well before the flush at src/internal.c:30227:

    ssl->alert_history.last_tx.code = type;
    ssl->alert_history.last_tx.level = severity;

The sequence:

  1. A fatal alert is started. SendAlert_ex() sets alert_history.last_tx.level to alert_fatal and marks the connection closed (src/internal.c:30151-30158).
  2. SendBuffered() fails with WANT_WRITE (src/internal.c:30227). The record bytes stay queued and undelivered.
  3. pendingAlert is cleared without a check of the result (src/internal.c:30229-30230), so the alert is not retried. Nothing reverts the history.
  4. A further error is processed. The guard in DoTls13HandShakeMsgType() sends an alert only when ssl->alert_history.last_tx.level != alert_fatal (src/tls13.c:16160-16161). It sees alert_fatal in the history and skips SendAlert().
  5. The TLS 1.3 branch of DoServerHello() applies the same test (src/internal.c:35305-35306) with the same result.

The comment above the first guard states its intent: skip when a fatal alert already went out. The history records that a send was attempted, not that it succeeded. The unconditional clear in step 3 is described on its own in BYTERAY-2026-0462.

Reachability and Preconditions

  • No build flag is required beyond TLS 1.3.
  • The application uses non-blocking sockets, and the flush of a first fatal alert returns WANT_WRITE. A remote peer can encourage this by not reading from its socket during teardown.
  • A second error is then processed on the same connection through one of the two guarded paths. DTLS 1.3 retransmission flows are one realistic case.
  • The attacker is the remote peer. No authentication is needed.

Impact

After one fatal alert is lost to backpressure, all later alerts on the connection are suppressed. The peer receives a truncated connection in place of the alerts the protocol requires, which hurts protocol compliance and operator diagnostics. There is no memory-safety or confidentiality effect. The timing window is narrow and cannot be steered to a specific outcome.

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 make the history reflect delivery. Either write alert_history.last_tx after SendBuffered() has succeeded and roll it back on failure, or make the two guards consult the pending or failed alert state as well as the history. In both cases the pendingAlert clear should depend on a successful flush, so that a transient WANT_WRITE does not silence the alert channel for the rest of the connection. There is no configuration workaround. Applications that use blocking sockets are not exposed to the WANT_WRITE path.

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