wolfSSL — Client Certificate Authentication Bypass on Session Ticket Resumption
A wolfSSL server marks the peer as authenticated as soon as it accepts a session ticket or TLS 1.3 PSK. The ticket does not record whether the original session presented a client certificate, so a ticket issued without client authentication resumes on a connection that requires a certificate.
- Advisory
- BYTERAY-2026-0304
- CWE
- CWE-267
- CVSS
- 8.1 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)
- Vendor
- wolfSSL
- Product
- wolfSSL
- Reported
- 2026-09-27
- Disclosure
- 2026-12-03
- Affected
- wolfSSL 5.9.2 (tested at master commit d95483f), TLS 1.2 and TLS 1.3 servers built with HAVE_SESSION_TICKET (--enable-session-ticket) that use one ticket key for connections with different client-certificate policies
- Credit
- Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.
Executive Summary
A wolfSSL server tracks whether the peer has been authenticated in one flag, ssl->options.peerAuthGood. In a full handshake with client-certificate verification the flag is set after the certificate and its signature have been checked. At the end of the handshake the server refuses to continue if the flag is clear.
On resumption the flag is set from possession of the ticket alone. When the server decrypts a TLS 1.2 session ticket, or accepts a TLS 1.3 pre-shared key identity, it sets peerAuthGood at once. Neither the ticket nor the session object stores whether the original session performed client authentication, so there is nothing for the server to consult. A resuming server also does not send a CertificateRequest, whatever verify mode the connection has.
A ticket obtained where no client certificate was required is therefore accepted on a connection configured with SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, as long as both use the same ticket key. The client completes the handshake without a certificate. The code is compiled when session tickets are enabled; the report describes that option as on in common TLS server builds.
Affected Products and Versions
- Component:
src/tls.c,TLSX_SessionTicket_Parse()for TLS 1.2. The TLS 1.3 pre-shared key path insrc/tls13.chas the same grant. - Required build:
HAVE_SESSION_TICKET(--enable-session-ticket). - Required configuration: the server applies different client-certificate policies to connections that share a ticket-encryption key. Examples are a per-connection or per-virtual-host
wolfSSL_set_verify()on oneWOLFSSL_CTX, or a policy that was tightened without rotating the ticket key. - Tested: wolfSSL master d95483fff72d6e987394b72edca433d4b580a0f4 (version string 5.9.2).
- The report does not class this as a default-build issue. It needs the session ticket option and the configuration above.
- Other releases were not checked.
Technical Details
TLSX_SessionTicket_Parse() handles the session_ticket extension of a ClientHello on the server. When DoClientTicket() accepts the ticket, the function does this (src/tls.c:6619-6624):
if (ret == WOLFSSL_TICKET_RET_OK) { /* use ticket to resume */
WOLFSSL_MSG("Using existing client ticket");
ssl->options.useTicket = 1;
ssl->options.resuming = 1;
/* SERVER: ticket is peer auth. */
ssl->options.peerAuthGood = 1;
The branch for WOLFSSL_TICKET_RET_CREATE repeats the assignment (src/tls.c:6633-6636). The TLS 1.3 pre-shared key path sets the flag at src/tls13.c:6897. The session-ID and secret-callback resumption paths in HandleTlsResumption() set it from a successful key derivation (src/internal.c:41648, src/internal.c:41804).
None of these sites looks at the verify mode of the accepting connection. They could not check the history of the session either: the ticket body, InternalTicket (wolfssl/internal.h:3784), and the session object, WOLFSSL_SESSION (wolfssl/internal.h:5064), have no field that says the original handshake verified a client certificate.
The flow on a strict connection:
- The client holds a ticket issued by the same server, or by another listener with the same ticket key, in a handshake where no client certificate was required.
- The client connects to a listener that has
wolfSSL_set_verify()set to require a certificate (src/ssl_api_cert.c:656) and sends the ticket in its ClientHello. DoClientTicket()(src/internal.c:44200) decrypts the ticket and checks the protocol version.TLSX_SessionTicket_Parse()setsuseTicket,resumingandpeerAuthGood.- The accept state machine sends a CertificateRequest only when
resumingis clear (src/ssl_api_hs.c:1037-1049). No certificate is requested. - The fail-safe check
if (!ssl->options.peerAuthGood)passes (src/ssl_api_hs.c:1114-1117). TLS 1.3 has the same check atsrc/tls13.c:18221-18222. - The abbreviated handshake completes. No certificate was sent or verified.
Because no certificate processing ran, the stored verification result is still zero. The report states that wolfSSL_get_verify_result() therefore returns X509_V_OK on such a connection.
Reachability and Preconditions
- Build: session tickets enabled.
- The attacker is a remote TLS client with no client certificate. No cryptographic break is involved.
- The attacker first obtains a ticket in the ordinary way, from a context where client authentication is not enforced. The ticket must decrypt under the key used by the strict connection.
- The server enforces client certificates on some connections and not on others with the same ticket key, or changed its policy and kept the key.
- A server that requires client certificates on every connection that can issue a ticket under a given key is not exposed through this route.
- Both TLS 1.2 tickets and TLS 1.3 pre-shared keys are affected.
Impact
A client without a certificate completes a handshake on a connection whose policy makes a client certificate mandatory. An application that treats a completed handshake on that listener as proof of a verified client certificate gives the client whatever access it binds to certificate holders. The verification result reads as success, so the application has no direct signal that verification did not take place. No peer certificate is available on the connection, and an application that reads the certificate before authorising a request would notice its absence.
ByteRay reproduced this with a wolfSSL server and client, built with --enable-session-ticket --enable-opensslextra, on one server context. A client with no certificate obtained a ticket on a connection without client verification. It then replayed the ticket on connections set to SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT. In TLS 1.2 and in TLS 1.3 wolfSSL_accept() succeeded, the session was reported as reused and the peer certificate was NULL. The same strict connection without a ticket was rejected with NO_PEER_CERT (-345).
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 carry client-authentication state in the resumption data. An authenticated-client marker belongs in InternalTicket and in WOLFSSL_SESSION, covered by the ticket's integrity protection, with tickets that lack it treated as unauthenticated. Each grant site then sets peerAuthGood only when the marker satisfies the policy of the accepting connection. When that connection requires a certificate and the resumed state has none, the server declines the resumption and runs a full handshake with a CertificateRequest. The verification result on a resumed connection should reflect what was verified.
Until an update is available:
- Do not share a ticket key between connections that require client certificates and connections that do not. Use separate
WOLFSSL_CTXobjects with separate ticket keys, and rotate the key when the policy is tightened. - For TLS 1.2,
wolfSSL_CTX_NoTicketTLSv12()on a listener that requires client certificates makes the server ignore the ticket extension (src/tls.c:6602-6603). ByteRay did not test an equivalent switch for TLS 1.3 pre-shared keys. - In the application, treat a connection with no peer certificate as unauthenticated even when the handshake succeeded.
Timeline
- 2026-09-27 — Reported to wolfSSL.
- 2026-12-03 — Public disclosure.
Credits
Discovered and reported by Mehrun P. Hunter and Shahriyar Jalayeri of ByteRay Ltd.
References
TLSX_SessionTicket_Parse, the TLS 1.2 grant, at the tested commit- Server accept path, CertificateRequest skipped on resumption
- Server accept path, the client authentication fail-safe
- Related advisory, stale ticket state on reused server objects: BYTERAY-2026-0307