Openssl · Openssl · CVE-2022-3602
**Name of the Vulnerable Software and Affected Versions**
OpenSSL versions 3.0.0 through 3.0.6
**Description**
A buffer overrun can be triggered in X.509 certificate verification, specifically in name constraint checking. This occurs after certificate chain signature verification and requires either a CA to have signed the malicious certificate or for the application to continue certificate verification despite failure to construct a path to a trusted issuer. An attacker can craft a malicious email address to overflow four attacker-controlled bytes on the stack, potentially resulting in a crash or remote code execution. Many platforms implement stack overflow protections which would mitigate against the risk of remote code execution. The risk may be further mitigated based on stack layout for any given platform/compiler. In a TLS client, this can be triggered by connecting to a malicious server. In a TLS server, this can be triggered if the server requests client authentication and a malicious client connects.
**Recommendations**
For OpenSSL versions 3.0.0 through 3.0.6, upgrade to OpenSSL 3.0.7 as soon as possible to fix the issue. As a temporary workaround, consider restricting access to the vulnerable X.509 certificate verification function until a patch is available. Additionally, restrict access to the `EVP EncryptInit ex2()`, `EVP DecryptInit ex2()`, and `EVP CipherInit ex2()` functions to minimize the risk of exploitation. Avoid using custom ciphers with NID undef using the legacy `EVP CIPHER meth new()` function until the issue is resolved.