Full Report
The openSSL component, versions 3.0.0 through 3.0.6, contains two buffer overflow vulnerabilities (CVE-2022-3602, CVE-2022-3786) in the X.509 certificate verification [0]. They could allow an attacker to create a denial of service condition or execute arbitrary code on a vulnerable TLS server (if the server requests client certificate authentication), or on a vulnerable TLS client. Siemens is preparing updates and recommends specific countermeasures for products where updates are not, or not yet available. [0] https://www.openssl.org/news/secadv/20221101.txt
Analysis Summary
# Vulnerability: OpenSSL 3.0.x X.509 Certificate Verification Buffer Overflows
## CVE Details
* **CVE ID:** CVE-2022-3602, CVE-2022-3786
* **CVSS Score:**
* CVE-2022-3602: 8.8 (High)
* CVE-2022-3786: 7.5 (High)
* **CWE:** CWE-121 (Stack-based Buffer Overflow)
## Affected Systems
* **Products:** Any software or hardware utilizing the OpenSSL 3.0 cryptographic library. Notable mention of Siemens industrial products.
* **Versions:** OpenSSL versions 3.0.0 through 3.0.6. (Note: OpenSSL 1.1.1 and 1.0.2 are **not** affected).
* **Configurations:**
* **TLS Clients:** Vulnerable when connecting to a malicious server.
* **TLS Servers:** Vulnerable if they request client certificate authentication (mutual TLS) and connect to a malicious client.
## Vulnerability Description
The flaws exist in the X.509 certificate verification logic, specifically during the processing of Punycode-encoded email addresses in the Name Constraints field.
* **CVE-2022-3786:** A buffer overflow can be triggered by a specially crafted email address that overflows an arbitrary number of bytes containing the `.` character (decimal 46) on the stack. This can lead to a Denial of Service (DoS) via a crash.
* **CVE-2022-3602:** A buffer overflow of exactly 4 bytes (a single 32-bit integer) can occur on the stack. While initially flagged as Critical due to potential Remote Code Execution (RCE), it was downgraded to High as many modern compilers include stack protections that mitigate RCE, though a crash (DoS) remains likely.
## Exploitation
* **Status:** PoC available; no widespread exploitation in the wild at the time of the initial advisory.
* **Complexity:** High (Requires crafting a specific certificate chain and bypassing modern OS exploit mitigations for RCE).
* **Attack Vector:** Network (Remote)
## Impact
* **Confidentiality:** Low (Potential for RCE, though unlikely in most environments).
* **Integrity:** Low (Potential for RCE).
* **Availability:** High (Resulting in a service crash/Denial of Service).
## Remediation
### Patches
* **OpenSSL 3.0.7:** All users of OpenSSL 3.0.x must upgrade to version 3.0.7 immediately.
* **Vendor Updates:** Apply patches from downstream vendors (e.g., Siemens, Linux distributions) as they become available for specific integrated products.
### Workarounds
* **Disable Client Authentication:** If operating a TLS server, disabling the request for client certificates removes the attack vector from malicious clients.
* **Name Constraints Filtering:** If possible, implement strict validation of certificate name constraints at the application layer before OpenSSL verification occurs.
## Detection
* **Indicators of Compromise:** Unusual application crashes (Segmentation Faults) in services utilizing TLS with certificate exchange.
* **Detection methods and tools:**
* Use `openssl version` to identify the version in use.
* Software Composition Analysis (SCA) tools to identify embedded OpenSSL 3.0.x libraries in binary files.
## References
* OpenSSL Security Advisory [20221101]: hxxps[://]www[.]openssl[.]org/news/secadv/20221101[.]txt
* Siemens Security Advisory: hxxps[://]cert-portal[.]siemens[.]com/productcert/pdf/ssa-403422[.]pdf
* NIST NVD CVE-2022-3602: hxxps[://]nvd[.]nist[.]gov/vuln/detail/CVE-2022-3602