# CVE-2022-3358: Using a Custom Cipher with NID\_undef may lead to NULL encryption

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 5.78% (percentile 94, 2026-11-26)
- **CWE:** CWE-476
- **Aliases:** GHSA-4f63-89w9-3jjv, RUSTSEC-2022-0059
- **Published:** 2022-10-11T12:00:00.000Z
- **Modified:** 2026-09-10T03:49:46.182Z

## Who should check

- Projects that depend on crates.io package openssl-src (\>= 300.0.0, \< 300.0.10)
- Anyone running OpenSSL Fixed in OpenSSL 3.0.6 (Affected 3.0.0-3.0.5)

## Description

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).

## Affected and fixed versions

- crates.io `openssl-src`: affected \>= 300.0.0, \< 300.0.10; fixed 300.0.10 (osv)
- OpenSSL: Fixed in OpenSSL 3.0.6 (Affected 3.0.0-3.0.5) (cvelist)

## Mitigation

- Upgrade openssl-src to 300.0.10 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-3358. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-3358.md
Affected: openssl-src >= 300.0.0, < 300.0.10
Fixed in: 300.0.10

Steps:
1. Search this machine and project for openssl-src (crates.io), OpenSSL: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-3358 being exploited?

There is no confirmed exploitation: CVE-2022-3358 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 5.78% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-3358?

High: CVSS 7.5 (v3.1, scored by NVD). Remote, no login needed.

### Which versions are affected by CVE-2022-3358?

openssl-src \>= 300.0.0, \< 300.0.10.

### Is there a fix for CVE-2022-3358?

Yes. Fixed in 300.0.10. Upgrade openssl-src to 300.0.10 or later.

### How do I check if I'm affected by CVE-2022-3358?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://www.openssl.org/news/secadv/20221011.txt>
- vendor: <https://security.gentoo.org/glsa/202402-08>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2022-3358>
- vendor: <https://rustsec.org/advisories/RUSTSEC-2022-0059.html>
- other: <https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=5485c56679d7c49b96e8fc8ca708b0b7e7c03c4b>
- other: <https://security.netapp.com/advisory/ntap-20221028-0014/>
- other: <https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0023>
- other: <https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=5485c56679d7c49b96e8fc8ca708b0b7e7c03c4b>
- other: <https://github.com/alexcrichton/openssl-src-rs>
- other: <https://security.netapp.com/advisory/ntap-20221028-0014>
- other: <https://crates.io/crates/openssl-src>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-3358>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-4f63-89w9-3jjv> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/RUSTSEC-2022-0059> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2022-3358> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-3358>
