Public Security Advisories
Coordinated vulnerability disclosures from Argus. Findings, impact, and remediation, published in good faith.
On heap-math builds the TLS 1.3 pre-master secret buffer is 512 bytes (578 with PSK), but an FFDHE-6144 or FFDHE-8192 key share produces a 768 or 1024-byte shared secret. wolfSSL wrote the secret without checking the buffer size, so a peer that negotiates one of those groups causes a heap write of up to 512 bytes past the buffer before authentication.
On heap-math builds a TLS 1.2 server computes the DHE pre-master secret into a 512-byte buffer (578 with PSK) without checking it against its configured DH prime. A server that uses a prime above 4096 bits writes past the buffer whenever a client completes a DHE key exchange, before the client is authenticated.
On heap-math builds with PSK, a TLS 1.2 server writes the DHE-PSK shared secret at offset 2 of a 578-byte buffer without checking it against its configured DH prime. With a prime above 4096 bits the write passes the end of the buffer on any DHE-PSK ClientKeyExchange, before the pre-shared key is looked up.
A TLS 1.2 DHE-PSK client writes the DH shared secret at offset 2 of a 578-byte buffer (heap-math builds) without checking it against the prime from the unsigned ServerKeyExchange. With wolfSSL's own key generation an oversized prime fails earlier with an error. The write is reachable when a PK callback generates the client's DH key pair.
The wolfSSL sniffer decrypts TLS 1.3 sessions that use a static DH key by computing the shared secret into a 512-byte buffer (heap-math builds) with no size check. With a 6144 or 8192-bit static key, any captured handshake that uses a finite-field group makes the sniffer write up to 512 bytes past the buffer.
For a list of embedded platform macros, and for Freescale builds with no RNG driver, wc_GenerateSeed compiles to a stub that fills the DRBG seed with the bytes 0, 1, 2 and so on. The build prints a warning and succeeds. Every random value the library then produces is the same on every device and every boot.
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.
In static-memory builds, wolfSSL frees a connection's own heap blocks with the heap of the WOLFSSL_CTX attached at teardown, not the heap that allocated them. When an SNI callback moves the connection to a CTX with a different heap through wolfSSL_set_SSL_CTX, static-pool blocks are handed to the wrong allocator.
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.
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.
A wolfSSL TLS 1.2 client tests the server's Diffie-Hellman prime for primality, but the two flags that control the test are set once per object and never re-armed. After one handshake, a client object reused through wolfSSL_clear() accepts any later server prime, including a composite modulus, without the test.
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.
In --enable-c89 builds the OpenSSL-compatibility X.509 printer formats a certificate's subjectAltName strings into an 80-byte stack buffer with a macro that discards the size, so a long alt name from a peer certificate overflows the stack when the certificate is printed.
On WOLF_C89 builds, XSNPRINTF expands to sprintf and ignores its size argument. X509PrintReqAttributes formats each CSR attribute value into an 80-byte stack buffer through that macro, so printing a request with a long attribute value writes past the buffer.
On WOLF_C89 builds, XSNPRINTF expands to sprintf and ignores its size argument. wolfSSL_X509V3_EXT_print formats the hex form of an Authority or Subject Key Identifier extension into a 129-byte stack buffer through that macro, so printing a certificate with a long key identifier writes past the buffer.
The PEM reader behind PEM_read_bio_X509_CRL and PEM_X509_INFO_read_bio reads one byte after the header delimiter without checking the buffer bound. When the delimiter ends on the last byte of the buffer, which a streaming BIO allows, that byte is written one position past the heap allocation.
In the wolfSSL sniffer, the handshake case of the record loop advances its cursor past the decryption trailer but does not reduce the remaining-bytes count by the same amount. A following handshake message in the same record is then length-checked against a stale count, and the sniffer reads past the end of the heap buffer that holds the decrypted record.
A TLS 1.2 DHE client writes the DH shared secret into a 512-byte buffer (heap-math builds) without checking it against the prime from the ServerKeyExchange. With wolfSSL's own key generation an oversized prime fails earlier with an error. The write is reachable when a PK callback generates the client's DH key pair.
For TLS 1.3 records the wolfSSL sniffer derives the padding size from the decrypted plaintext and does not bound it. The handshake record loop advances by that size without adjusting its remaining-bytes count, so a following handshake message can make the sniffer read up to about a full record length past the heap buffer that holds the decrypted record.
A wolfSSL DTLS 1.3 client whose ECH offer was not accepted skips NewSessionTicket messages by advancing the record cursor by the message size plus the record padding, which the record layer also counts. The input-buffer index ends past the buffered data, and later datagrams are parsed against corrupted buffer state.
wolfSSL returns decrypted application data through a pointer into its receive buffer. When more input is already buffered and the next record needs a larger buffer, GetInputData_ex() reallocates the buffer without checking for pending plaintext, and the next wolfSSL_read() copies from the freed block.
In DTLS multicast builds, ChangeCipherSpec processing uses the peer ID byte from the record header as a direct index into the 100-entry per-peer sequence table. An enrolled ID of 100 to 255 makes the update write past the table, and an in-range ID updates the entry at that index, not the entry enrolled for the peer.
// No embargoed advisories.