wolfSSL — Unscoped Client-Authentication Grant in SSLv2-Format ClientHello Resumption
The handler for SSLv2-format ClientHello records sets the peer-authentication flag on session resumption from possession of the session secret alone. On the tested code this resumption path always aborts before the handshake completes, so the grant is a latent gap that a fix to the other resumption paths would miss.
- Advisory
- BYTERAY-2026-0471
- CWE
- CWE-267
- CVSS
- 3.7 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N)
- Vendor
- wolfSSL
- Product
- wolfSSL
- Reported
- 2026-09-28
- Disclosure
- 2026-12-03
- Affected
- wolfSSL 5.9.2 (tested at master commit d95483f), server builds with OLD_HELLO_ALLOWED
- Credit
- Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.
Executive Summary
ProcessOldClientHello() in src/internal.c handles SSLv2-format ClientHello records. It is compiled only with OLD_HELLO_ALLOWED, which is off by default. Its resumption branch looks up the session named by the client, derives keys, and sets ssl->options.peerAuthGood.
That flag means the peer has satisfied client authentication. The cached session records nothing about whether the original handshake authenticated the client with a certificate, so the grant rests on possession of the session secret. The server then skips the certificate request on the resumed connection, and the final client-authentication check passes because the flag is already set.
On the tested code this is not a working bypass. The resumption branch returns before the ClientHello is registered as received. The server then rejects the client's ChangeCipherSpec and Finished, and every handshake resumed through this handler aborts. The defect is a grant site with the same flaw as the other resumption paths, held back only by an unrelated message-ordering side effect.
Affected Products and Versions
- Component:
src/internal.c,ProcessOldClientHello(), the resumption branch. - Required build: a server built with
OLD_HELLO_ALLOWED. The option is documented as default off (src/internal.c:69), and the handler is compiled only inside that guard (src/internal.c:41356-41575). - Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
- A default build does not include this code.
- Other releases were not checked.
Technical Details
The grant is at src/internal.c:41563, inside if (ssl->options.resuming) (src/internal.c:41527):
/* SERVER: peer auth based on session secret. */
ssl->options.peerAuthGood = (ret == 0);
ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
return ret;
The same assignment and comment appear at src/internal.c:41648 and src/internal.c:41804. WOLFSSL_SESSION (wolfssl/internal.h:5086-5145) has no client-authentication field to consult.
- An SSLv2-format ClientHello with a known session ID is dispatched to
ProcessOldClientHello()directly from the record path (src/internal.c:25763). - The session is found (
src/internal.c:41536), keys are derived, andpeerAuthGoodis set. - The branch returns at
src/internal.c:41566, beforeSanityCheckMsgReceived(ssl, client_hello)atsrc/internal.c:41572. Because the handler is not called throughDoHandShakeMsgType(),msgsReceived.got_client_hellois never set. wolfSSL_accept()skipsSendCertificateRequest()on a resumption (src/ssl_api_hs.c:1037-1049), and the fail-safe atsrc/ssl_api_hs.c:1114-1117passes.- The client's ChangeCipherSpec is rejected with
OUT_OF_ORDER_Ebecause no ClientHello was registered (src/internal.c:20549-20552). The client's Finished then fails withNO_CHANGE_CIPHER_E(src/internal.c:20491-20494). The handshake aborts before application data.
Reachability and Preconditions
- Build:
OLD_HELLO_ALLOWED. Not a default configuration. - Runtime: a server whose session cache holds a session from a context where client authentication was not performed or was weaker, and an accepting connection that requires a client certificate.
- Attacker position: a remote client that knows a valid session ID and its secret.
- On the tested code the handshake does not complete under any of these conditions, for TLS or DTLS.
Impact
None is realized on the tested code. The flag is granted, the certificate request is skipped and the fail-safe passes, but the handshake then aborts and the granted status is never used.
The concern is fix completeness. If the missing ClientHello registration were repaired without scoping this grant, a client holding only a cached session would be treated as certificate-authenticated on a connection that requires a client certificate. A hardening pass over the other resumption grant sites that does not include this one leaves it behind a build option where it is easy to miss.
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 record in WOLFSSL_SESSION whether the original handshake performed client-certificate authentication and under what policy, and to set peerAuthGood on resumption only when that state is at least as strict as the current connection requires. The same treatment applies to the two sibling grants. The current handshake abort should not be relied on as the control, since it comes from the registration anomaly and not from an authorization check. Workaround: leave OLD_HELLO_ALLOWED undefined. That is the default.
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.