CVE-2022-3358 — Vulnerability in openssl-src — CVE Details
Using a Custom Cipher with `NID_undef` may lead to NULL encryption
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (5.78%). Schedule for your next planned update.
Does your project use an affected openssl-src version?
Paste your Cargo.lock to check it for CVE-2022-3358 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
OpenSSL supports creating a custom cipher via the legacy EVP_CIPHER_meth_new() function and associated function calls. This function was deprecated in OpenSSL 3.0 and application authors are instead encouraged to use the new provider mechanism in order to implement custom ciphers. OpenSSL versions 3.0.0 to 3.0.5 incorrectly handle legacy custom ciphers passed to the EVP_EncryptInit_ex2(), EVP_DecryptInit_ex2() and EVP_CipherInit_ex2() functions (as well as other similarly named encryption and decryption initialisation functions). Instead of using the custom cipher directly it incorrectly tries to fetch an equivalent cipher from the available providers. An equivalent cipher is found based on the NID passed to EVP_CIPHER_meth_new(). This NID is supposed to represent the unique NID for a given cipher. However it is possible for an application to incorrectly pass NID_undef as this value in the call to EVP_CIPHER_meth_new(). When NID_undef is used in this way the OpenSSL encryption/decryption initialisation function will match the NULL cipher as being equivalent and will fetch this from the available providers. This will succeed if the default provider has been loaded (or if a third party provider has been loaded that offers this cipher). Using the NULL cipher means that the plaintext is emitted as the ciphertext. Applications are only affected by this issue if they call EVP_CIPHER_meth_new() using NID_undef and subsequently use it in a call to an encryption/decryption initialisation function. Applications that only use SSL/TLS are not impacted by this issue. Fixed in OpenSSL 3.0.6 (Affected 3.0.0-3.0.5).
Advisory Timeline
- First published October 11, 2022 (1508 days ago).
- Last revised September 10, 2026 — 1429 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p openssl-src --precise 300.0.10
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| openssl-src crates.io · Affected: All versions | 300.0.10 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-476NULL Pointer DereferenceMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-3358ADVISORY
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=5485c56679d7c49b96e8fc8ca708b0b7e7c03c4bWEB
- https://github.com/alexcrichton/openssl-src-rsPACKAGE
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0023WEB
- https://rustsec.org/advisories/RUSTSEC-2022-0059.htmlWEB
- https://security.gentoo.org/glsa/202402-08WEB
- https://security.netapp.com/advisory/ntap-20221028-0014WEB
- https://www.openssl.org/news/secadv/20221011.txtWEB
Frequently Asked Questions
- What is CVE-2022-3358?
- Using a Custom Cipher with `NID_undef` may lead to NULL encryption. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2022-3358?
- CVE-2022-3358 affects openssl-src. It has a 5.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-3358 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top 10% of EPSS-scored vulnerabilities — 93.9% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2021-3711CRITICAL
SM2 Decryption Buffer Overflow
- CVE-2022-2274CRITICAL
openssl-src heap memory corruption with RSA private key operation
- CVE-2022-3602CRITICAL
X.509 Email Address 4-byte Buffer Overflow
- CVE-2023-0216HIGH
openssl-src subject to Invalid pointer dereference in `d2i_PKCS7` functions
- CVE-2022-1473HIGH
Resource leakage when decoding certificates and keys
- CVE-2022-3786HIGH
X.509 Email Address Variable Length Buffer Overflow
- CVE-2021-4044HIGH
Invalid handling of `X509_verify_cert()` internal errors in libssl
- CVE-2021-3712HIGH
Read buffer overruns processing ASN.1 strings