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.
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.
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 OpenSSL-compatible EVP layer, ARIA-GCM initialisation accepts a NULL IV and returns success without setting a nonce. The context then encrypts and decrypts every message with its zero-filled IV buffer as the GCM nonce, so all messages under one key share a keystream.
After each ARIA-GCM message, the EVP layer zeroes the context IV and then copies the unadvanced nonce from the cipher state back into it. A context reused for further messages without a new IV encrypts them under the first message's key and nonce, and every call returns success.
After each AES-CCM message, the EVP layer zeroes the context IV and then copies the unchanged nonce from the AES state back into it. The control that would advance the nonce is not implemented for CCM. A context reused for further messages without a new IV encrypts them under the first message's key and nonce.
After each SM4-GCM message, the EVP layer zeroes the context IV, and the IV store helper then copies that zeroed buffer into the SM4 state where other ciphers restore a nonce. Later messages on the same context are sealed under the key with an all-zero nonce, and every call returns success.
After each SM4-CCM message, the EVP layer zeroes the context IV, and the IV store helper then copies that zeroed buffer into the SM4 state where other ciphers restore a nonce. Later messages on the same context are processed under the key with an all-zero nonce, and every call returns success.
wolfSSL_ASN1_STRING_print replaces control bytes with dots but leaves carriage return and line feed as they are. wolfSSL_GENERAL_NAME_print uses it for the email, DNS and URI names of a certificate, so a subject alternative name containing CR or LF adds lines of the certificate author's choosing to the printed output.
wolfSSL_GENERAL_NAME_print prints a directoryName alternative name with the XN_FLAG_ONELINE flag set, which in wolfSSL did not include control-character escaping. Attribute values of the directory name are written to the output byte for byte, so a value containing CR or LF adds lines chosen by the certificate author to the printed text.
The text dump of an X.509 attribute certificate prints the directory names of the holder and the issuer by copying their attribute values to the output unchanged. An attribute certificate whose holder or issuer name contains CR or LF adds lines of its author's choosing to the dump. Only builds with attribute certificate support and applications that print untrusted attribute certificates are affected.
wolfSSL_X509_CRL_print writes the CRL issuer name to the output without escaping control characters. A CRL whose issuer contains CR or LF adds lines of its author's choosing to the printed text. The CRL does not need a valid signature to be loaded and printed. Applications that print CRLs from untrusted sources into line-based output are affected.
wolfSSL_X509_REQ_print writes the subject of a certificate signing request to the output without escaping control characters. A request whose subject contains CR or LF adds lines chosen by the submitter to the printed text. Services that print or log requests they receive, such as enrolment front ends, are affected.
The certificate text dump in wolfSSL's OpenSSL compatibility layer prints dNSName, rfc822Name and URI subject alternative names with a plain string format and no escaping. An entry that contains CR or LF adds lines of the certificate author's choosing to the printed text. Each entry is limited to under 80 bytes. Applications that print peer certificates into line-based output are affected.
When the certificate text dump in wolfSSL's OpenSSL compatibility layer prints a directoryName subject alternative name, it copies the country, organization, unit and common name values into the output byte for byte. A value that contains CR or LF adds lines of the certificate author's choosing to the printed text. The whole entry is limited to under 80 bytes.
The certificate text dump in wolfSSL's OpenSSL compatibility layer writes subject and issuer name values to the output without escaping control characters. A certificate whose name contains CR or LF adds lines of the sender's choosing to the printed text. Applications that print peer certificates into logs or other line-based output are affected.
wolfSSL_X509_REQ_print writes the attributes of a certificate signing request, such as the challenge password and unstructured name, with a plain string format and no escaping. An attribute value that contains CR or LF adds lines chosen by the submitter to the printed text. The value is limited to about 49 bytes. Only builds with the full OpenSSL compatibility layer and certificate generation are affected.
In IPv6 builds of the OpenSSL compatibility layer, wolfSSL_BIO_new_accept searches for a colon after the closing bracket of an IPv6 literal and passes the result to atoi without a NULL check. An accept string such as "[::1]" with no port makes the process read through a NULL pointer.
During the TLS handshake, wolfSSL compares the configured host name with the peer certificate using matching flags fixed at zero. Host flags set with X509_VERIFY_PARAM_set_hostflags, such as the no-wildcards flag, are never read on this path, so a certificate with a wildcard name is accepted for a host name the application asked to match literally.
wolfSSL_X509_VERIFY_PARAM_inherit copies the host-matching flags only inside the branch that copies the host name. When the source parameter carries flags such as the no-wildcards flag but no host name, the flags are dropped without an error, and store-side host name verification then accepts wildcard certificate names the application asked to reject.
The RFC 2253 escaping branch of wolfSSL_ASN1_STRING_print_ex finds the end of a string by scanning for a NUL byte and ignores the stored length. Strings returned by the RFC 3161 time-stamp getters have no terminator, so printing one reads past the response buffer and writes the bytes it passes to the output BIO.
// No embargoed advisories.