wolfSSL — Unscoped Server-Authentication Grant in TLS 1.3 Client Ticket Resumption
When a TLS 1.3 server selects the client's resumption PSK, the wolfSSL client marks the server as authenticated without consulting any record of whether the original session verified a certificate. A ticket obtained without verification resumes on a connection that requires it, and the verify result reads as success.
- Advisory
- BYTERAY-2026-0472
- 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), TLS 1.3 clients with session tickets that resume a session created or imported under a weaker verification policy
- Credit
- Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.
Executive Summary
SetupPskKey() in src/tls13.c prepares the pre-shared key for a TLS 1.3 handshake. For a resumption PSK the client derives the key from its stored ticket material. When the ServerHello confirms that identity, the function sets ssl->options.peerAuthGood = 1.
The cached session has no field that records whether the server's certificate was verified in the original connection. The grant is therefore based on ticket possession and the server's confirmation alone. It satisfies the client's "Server authentication did not happen" fail-safe, no certificate is processed, and wolfSSL_get_verify_result() reports success because the verify result is never written on this path.
The exposure is narrower than impersonation. TLS 1.3 resumption still requires the peer to prove knowledge of the resumption secret in its Finished message, so the peer is the original ticket issuer, and a network attacker without that secret cannot use the grant. The behaviour matches RFC 8446 resumption as other TLS stacks implement it. The gap is that a ticket created under a no-verify policy can be resumed on a connection that requires verification, with no check and a clean verify result.
Affected Products and Versions
- Component:
src/tls13.c,SetupPskKey(), thepsk->resumptionbranch, client side. - Required build: TLS 1.3 with
HAVE_SESSION_TICKET. - Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
- No further build option is required. Which configurations define
HAVE_SESSION_TICKETby default was not assessed. - Other releases were not checked.
Technical Details
The grant is at src/tls13.c:4417-4420, directly after the PSK derivation at src/tls13.c:4413-4416:
if (!clientHello) {
/* CLIENT: using secret in ticket for peer authentication. */
ssl->options.peerAuthGood = 1;
}
- The client offers a resumption identity from a cached session.
WOLFSSL_SESSION(wolfssl/internal.h:5086-5145) carries no server-authentication state. - The ServerHello selects that identity.
SetupPskKey()runs withclientHellofalse, derives the PSK from the stored ticket nonce and setspeerAuthGood. - The fail-safe in
wolfSSL_connect_TLSv13(), stateFIRST_REPLY_SECOND(src/tls13.c:16733-16739), passes. It runs before the client sends its own Certificate and CertificateVerify. ssl->peerVerifyRetis not touched, so the verify result stays at success.
The external-PSK branch of the same function shows what the flag means. With WOLFSSL_CERT_WITH_EXTERN_PSK it resets peerAuthGood to 0 with the comment "Certificate authentication is still required" (src/tls13.c:4558-4563). The resumption branch has no equivalent.
Reachability and Preconditions
- Build: TLS 1.3 client with session tickets.
- Runtime: the client resumes a session whose ticket was obtained under a no-verify policy, or that was issued by an endpoint the application did not verify, on a connection that now requires server-certificate verification.
- Attacker position: the server side of the resumed handshake, holding the resumption secret. This is the ticket issuer or a holder of stolen or exported session state.
- A network attacker without the resumption secret cannot complete the handshake.
Impact
The handshake completes without certificate verification on a connection whose policy requires it, and wolfSSL_get_verify_result() reports success. The channel remains keyed to the ticket issuer's secret, so confidentiality against third parties holds. The harm is confusion about what was verified when tickets move between policies. With mutual TLS configured, the client also sends its own certificate to a peer the application believed was certificate-verified.
This is a hardening gap in how the grant is scoped. It is not directly exploitable from the network.
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 store the original session's server-authentication state in WOLFSSL_SESSION and to set peerAuthGood on resumption only when that state satisfies the current connection's policy. If it does not, the client should reject the resumption and fall back to a full handshake. The verify result for PSK-only resumption should show that no certificate was processed. The meaning of peerAuthGood should be the same at every grant site.
Workaround: do not resume tickets that were obtained under a weaker verification policy, and do not share sessions between client contexts with different policies.
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.