CVE-2026-94419: Client session cache reference poisoning allows resumption with wrong server
Without NOSESSIONCACHEREF, wolfSSLgetsession() does not return a session object but a ClientSession reference of the form {row, index, hash(sessionID)} into the process-global SessionCache, and ClientSessionToSession() validates it against that hash alone. Because the TLS 1.2 session ID is chosen by the server and sent in clear, AddSessionToCache() matches any other server's session on the same ID and overwrites the client-side entry with that server's master secret, cipher suite and version, while the handle continues to resolve; nothing on the write path compares the peer, the application's server ID or the WOLFSSLCTX. Resuming through the handle then produces an abbreviated handshake in which no Certificate message is sent, so neither chain verification nor wolfSSLcheckdomainname() runs, and the attacker is accepted as the original server for the whole of that connection. Affected builds are those leaving NOSESSIONCACHEREF, NOSESSIONCACHE, NOCLIENTCACHE and TITANSESSIONCACHE all undefined, which includes a plain ./configure, --enable-opensslextra and --enable-opensslall; fifteen integration options define NOSESSIONCACHEREF and are therefore not affected, among them --enable-all, --enable-distro, --enable-curl, --enable-nginx, --enable-haproxy, --enable-stunnel, --enable-wpas and the rest of the OPENSSLCOMPATIBLEDEFAULTS family, and --enable-leanpsk, --enable-leantls, --enable-lowresource and --enable-tinytls13 disable the cache outright. The application must use the legacy reference flow, wolfSSLgetsession() or SSLgetsession() followed by wolfSSLsetsession(); wolfSSLget1session() returns the session object itself and is not affected, nor are wolfSSLSetServerID() lookups. Only TLS 1.2 and below and DTLS 1.2 and below are reachable, since TLS 1.3 and ticket resumption with an empty ServerHello session ID both use a client-chosen cache key. The poisoned entry lives in the process-global cache, so it crosses WOLFSSLCTX boundaries and persists until the entry is evicted or the session times out, 500 seconds by default. Releases v5.3.0 through v5.9.2 are affected; the fix adds a per-write generation counter to the cache and raises WOLFSSLCACHEVERSION from 2 to 3, so a cache persisted by an older build is rejected by a fixed one.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Build with an integration option that defines NO_SESSION_CACHE_REF, such as --enable-all, --enable-distro, --enable-curl, --enable-nginx, --enable-haproxy, --enable-stunnel, or --enable-wpas, to avoid the affected client session cache reference flow.
wolfSSL NO_SESSION_CACHE_REF = defined
Event History
Frequently Asked Questions
Which builds are affected by default?
Builds are affected when NO_SESSION_CACHE_REF, NO_SESSION_CACHE, NO_CLIENT_CACHE, and TITAN_SESSION_CACHE are all undefined. This includes a plain ./configure build and builds using --enable-opensslextra or --enable-opensslall.
What does an attacker need to control to trigger the issue?
The attacker-controlled server needs to use the same TLS 1.2 session ID as a session cached for another server. TLS 1.2 session IDs are selected by the server and sent in clear.
Why can the resumed connection be accepted without normal server identity checks?
The resumed connection uses an abbreviated handshake that does not send a Certificate message. As a result, certificate-chain verification and wolfSSL_check_domain_name() do not run for that connection.
What configuration change can reduce exposure if a patch cannot be applied immediately?
Use a build configuration that defines NO_SESSION_CACHE_REF. Builds with that option defined are not affected by the described ClientSession reference behavior.