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.
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.
A wolfSSL server sets options.useTicket when a ClientHello carries a session ticket extension and no reset path clears it. On an object reused with wolfSSL_clear(), a later ClientHello with any session ID resumes the retained session and derives keys from a master secret that wolfSSL_clear() zeroed.
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.
A TLS 1.2 or DTLS 1.2 session ticket carries the session ID context of the connection that issued it, but the server never compares that context when the ticket is presented. A ticket issued under one context resumes under another that shares the ticket-encryption key, with peer authentication taken as done.
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.
A TLS 1.3 client records that the server selected a pre-shared key in a flag that wolfSSL_clear does not reset. After a PSK or resumption handshake, a client object that is cleared and reused rejects the next full certificate handshake with a message-ordering error. The stale flag does not let a server skip authentication.
The handler for SSLv2-format ClientHello messages sets the server's resumption flag but never clears it, and wolfSSL_clear does not reset it either. On a reused server object, a hello with no session id is processed as a resumption left over from the previous connection: keys are derived and the client is marked authenticated before the handshake fails at ChangeCipherSpec.
The server-side resumption handler rejects a ClientHello that drops extended master secret or omits the resumed session's cipher suite, but the fatal alerts for those three cases are compiled only with WOLFSSL_EXTRA_ALERTS. A default build ends the handshake without an alert.
On a resumed TLS 1.2 handshake the wolfSSL client marks the server as authenticated as soon as it has copied the cached master secret. The session records nothing about whether the server certificate was verified when it was created, so a session made without verification resumes on a connection that requires it.
When a server application supplies the master secret through a session-secret callback, the TLS 1.2 resumption code marks the peer as authenticated and returns before the ticket expiry check. An expired ticket that still decrypts completes resumption with the peer-authentication flag set.
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.
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.
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 a new session ticket replaces a stored one, SetTicket and wolfSSL_set_SessionTicket free the previous heap-allocated ticket without clearing it. The old ticket, which a server may still accept, remains in freed heap memory after every renewal.
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.
wolfSSL compares a ticket's or cached session's session ID context with the receiving endpoint's only when the receiver has one configured. An endpoint with no context, the default, accepts sessions created under any other context that shares its ticket keys or session cache.
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.
The TLS 1.3 ticket lifetime check in wolfSSL rejects tickets that are too old but not tickets whose timestamp is ahead of the server clock. After a backward clock step, a ticket holder can choose its obfuscated ticket age to pass the second age check and resume an expired ticket.
The TLS 1.2 and DTLS 1.2 resumption path treats a session as expired only when the server clock is past its creation time plus the timeout. A ticket whose creation time is ahead of the clock, as after a backward clock step, is never rejected and resumes beyond its intended lifetime.
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.