Public Security Advisories
Coordinated vulnerability disclosures from Argus. Findings, impact, and remediation, published in good faith.
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.
With WOLFSSL_THREADED_CRYPT, the per-record AES-GCM nonce field that the worker-thread encrypt call reads is populated from the connection IVs only in old FIPS builds and is otherwise left at zero. The worker's error return is discarded and eight bytes of that field are copied into the record. In ByteRay's tests the peer rejected these records while wolfSSL_write reported success.
With WOLFSSL_THREADED_CRYPT, application records are handed to worker threads for encryption. The TLS 1.3 record builder has no such handoff and encrypts inline, but the send path still queues the finished record as a TLS 1.2 job. With AES-GCM the worker corrupts the record before it is sent; with other suites the record is never sent and the seventeenth write spins forever.
The WOLFSSL_THREADED_CRYPT job slots are shared between the connection thread and worker threads through plain integer flags with no synchronisation. A slot is reported ready before its record is staged, connection teardown frees cipher state and job buffers while workers may still use them, and the send path ignores a failed output buffer allocation before copying a full record.
When record decryption fails on a TLS stream, DoProcessReplyEx returns without consuming the record or resetting its state. During shutdown the failure is not stored in ssl->error, so wolfSSL_shutdown reports the retryable WOLFSSL_SHUTDOWN_NOT_DONE and each retry fails on the same record and queues another alert.
When an Encrypt-then-MAC record fails its MAC check on a TCP connection, wolfSSL returns an error without consuming the record or resetting the record state machine. wolfSSL_shutdown then reports this permanent failure as WOLFSSL_SHUTDOWN_NOT_DONE, so an application that follows the documented retry loop calls it forever.
The function that waits for the peer's close_notify during wolfSSL_shutdown does not store the record-processing result in ssl->error. A permanent record failure, such as a failed MAC check, is returned as WOLFSSL_SHUTDOWN_NOT_DONE, and the failed record stays in the input buffer, so the documented retry loop never ends.
DoAlert rejects an alert record whose payload is not exactly two bytes, but the fatal unexpected_message alert it sends in reply is compiled only with WOLFSSL_EXTRA_ALERTS. A default build drops the connection without telling the peer why.
wolfSSL closes a connection after WOLFSSL_MAX_EMPTY_RECORDS consecutive zero-length application-data records. The fatal unexpected_message alert for that case is compiled only with WOLFSSL_EXTRA_ALERTS, so a default build returns EMPTY_RECORD_LIMIT_E and sends nothing.
When the record loop fails to read a record body for a reason other than WANT_READ, for example MEMORY_E while growing the input buffer, the fatal alert is compiled only with WOLFSSL_EXTRA_ALERTS. A default build returns the raw error, and the DTLS branch has no alert in any build.
SendAlert_ex clears the pending-alert marker after calling SendBuffered without checking the result. When the flush fails with WANT_WRITE on a non-blocking socket, the retry hook finds no pending alert and the fatal alert is never retransmitted, so the peer sees the connection drop without it.
SendFatalAlertOnly, the function that turns a handshake error code into a fatal alert, is an empty stub unless WOLFSSL_EXTRA_ALERTS is defined. In a default build, out-of-order, duplicate and wrong-side handshake messages end the TLS 1.2 or DTLS connection without an alert.
In asynchronous-crypto builds, two pend-resume blocks in the TLS 1.3 record receiver add the record padding length to the input cursor without checking the cursor against the buffer length. No current input reaches these blocks with an over-advanced cursor; the gap matters for fixes that guard only the normal record-done path.
Two server-side early-data exits in DoProcessReplyEx add the record padding size to the shared input cursor and return success without comparing the cursor to the buffered length. Every current server-side TLS 1.3 handler consumes its message exactly, so this is a missing check and not a reachable out-of-bounds access.
GetInputData_ex rejects a negative used length or maximum length only in its non-DTLS branch, and the DTLS fast path in the record loop skips the refill call when an unsigned length difference is large. A corrupted input buffer descriptor that ends a TLS connection with an error is therefore parsed on DTLS, leading to reads past a 5-byte buffer.
ShrinkInputBuffer computes the bytes left in the input buffer as a signed value and checks it only against an upper limit. A negative value, which means the cursor is already past the buffered data, is accepted: the dynamic buffer is freed and the 5-byte static buffer is installed with a length of about 4 GB.
When the record layer needs a larger output buffer, wolfSSL copies the queued record bytes to a new block and frees the old one without clearing it. The shrink paths clear the same buffers before freeing them. The input buffer is cleared on growth only while send-side encryption is on.
// No embargoed advisories.