Public Security Advisories
Coordinated vulnerability disclosures from Argus. Findings, impact, and remediation, published in good faith.
wolfSSL_GetSessionFromCache passed the external session cache get callback a copy flag that started at 0 and released the returned session whenever the flag was still 0. A callback that kept its session and did not write the flag had the session freed under it, and the next resumption with the same session ID read and released freed memory.
GetSesionFromCacheOrExt passed the external session cache get callback a copy flag that started at 0, and wolfSSL released the returned session whenever the flag was still 0. A callback that kept its session and did not write the flag had it freed, and the next TLS 1.3 resumption with the same ticket identity read and released freed memory.
TlsSessionIdIsValid looks up the session ID of a DTLS ClientHello through the external session cache get callback with a copy flag that has no initial value, and releases the returned session when the flag reads zero without holding a reference. A session the application still keeps can be freed, and a repeated ClientHello then reads and frees it again.
In static-memory builds with WOLFSSL_TICKET_NONCE_MALLOC, a TLS 1.3 ticket nonce longer than the inline buffer is allocated from the connection's memory pool and stored in the session cache, which later frees it with a NULL heap hint. A server that sends a long nonce makes the client pass a pool-interior pointer to the system allocator when the entry is evicted.
On a TLS client, wolfSSL_get_session() returns a 12-byte cache locator cast to WOLFSSL_SESSION. wolfSSL_SESSION_set1_id() and wolfSSL_SESSION_set1_id_context() write through that pointer as if it were a full session, placing up to 32 caller-supplied bytes about 100 bytes past the locator in the global client session cache.
wolfSSL_save_session_cache writes the in-memory session cache to a file verbatim, including each session's master secret and ticket data, with no encryption. On POSIX the file is created with mode 0600 since 5.9.4; in 5.9.2 and on other platforms its permissions come from a plain fopen call.
When a session with an oversized ticket is added to the session cache, wolfSSL allocates the temporary ticket buffer with a NULL heap hint but one error path frees it with the session's static-pool hint. In static-memory builds the system-heap block is linked into the pool's free list.
When a session cache entry is overwritten, wolfSSL frees the old entry's dynamically allocated TLS 1.3 ticket nonce with the heap hint of the connection doing the overwrite, not the one that allocated it. In static-memory builds that mix heap hints over the shared cache, the buffer goes to the wrong allocator.
The TLS 1.2 and DTLS 1.2 session cache is shared by every WOLFSSL_CTX in a process and is searched by session ID and side only. A client holding a session from one context can resume it on another context in the same process, which then skips its own client authentication.
A TLS 1.3 stateful ticket is a 32-byte identity that indexes the process-wide session cache. The lookup matches on identity and side only, so a ticket issued by one WOLFSSL_CTX resumes on another in the same process, which then skips its own client authentication.
Several public session accessors return pointers into a live session cache entry after releasing the cache locks. A handshake on another thread that stores a session with the same ID overwrites that entry in place, so the reader can see torn session data or, with session certificates enabled, a wrong or freed peer certificate pointer.
When AddSessionToCache overwrites an existing cache entry and the new ticket needs a larger buffer, the previous dynamically allocated ticket is freed without being wiped. The old ticket stays in freed heap memory until the allocator reuses the block.
When wolfSSL_DupSessionEx copies a session over one that already holds a heap-allocated ticket, the old ticket buffer is freed or reallocated without being cleared on every path. The previous ticket remains in freed heap memory.
wolfSSL_FreeSession clears the master secret and session id before freeing a session but releases the heap-allocated session ticket and TLS 1.3 ticket nonce without clearing them. EvictSessionFromCache has the same gap. Ticket material remains in freed heap memory.
During a session cache lookup, wolfSSL_GetSessionFromCache frees the destination session's existing heap-allocated ticket without clearing it before it installs a preallocated buffer. The previous ticket remains in freed heap memory on the resumption path.
With WOLFSSL_DTLS_NO_HVR_ON_RESUME, a DTLS 1.2 server skips the cookie exchange when the ClientHello session ID matches any entry in the process-wide session cache. The match is not tied to the receiving context, so a known session ID lets spoofed ClientHellos reach stateful handshake processing.
wolfSSL_GetSessionFromCache rejects a cached session only when the current time is past its creation time plus its timeout. After a backward step of the server clock, an entry that had already expired passes the check again and can be resumed for roughly the size of the rollback.
// No embargoed advisories.