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.
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 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.
A wolfSSL TLS 1.2 client tests the server's Diffie-Hellman prime for primality once per connection object and remembers the result in a flag that renegotiation does not reset. A server that sends different DH parameters in a renegotiation has them accepted without the primality test, so the renegotiated key exchange can run over a composite modulus.
In a default build InitSSL_Ctx sets the minimum accepted key sizes to 1024 bits for Diffie-Hellman and 1024 bits for RSA, about 80-bit security. Every connection inherits them, so a client completes a handshake with a server that sends a 1024-bit DHE group or presents a 1024-bit RSA certificate. The 2048-bit floors exist only in opt-in hardened builds.
The buffer that holds the TLS 1.2 DHE-PSK pre-master secret reserves space for one 2-byte length field, but the composition writes two. With a 4096-bit DH prime and a 63- or 64-byte PSK, MakePSKPreMasterSecret writes one or two bytes past the end of the heap allocation. No capacity check exists on the path.
When WC_NO_CACHE_RESISTANT is defined, _sp_exptmod_ex in the SP math backend squares and multiplies into a temporary chosen by the current secret exponent bit. The masked constant-address variant in the same function is compiled out. No shipped configuration combines SP math with the macro.
In the TFM backend, fp_exptmod sends a base of 2 to _fp_exptmod_base_2 before it selects the timing-resistant ladder. That routine does work that varies with the secret exponent bits, and DH key generation with generator 2 runs it on the private exponent.
The ESP-IDF and Arduino ESP32 platform defaults define WC_NO_CACHE_RESISTANT. With it, the TFM exponentiation ladder _fp_exptmod_ct selects the operands of its multiply and square by the current secret exponent bit, and the variant that keeps operand addresses constant is compiled out.
// No embargoed advisories.