# CVE-2026-31790: Incorrect Failure Handling in RSA KEM RSASVE Encapsulation

> 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, CNA) `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:** 0.47% (percentile 32, 2026-11-26)
- **CWE:** CWE-754
- **Published:** 2026-04-07T22:00:56.698Z
- **Modified:** 2026-07-24T23:10:00.563Z

## Who should check

- Anyone running OpenSSL \>= 3.6.0, \< 3.6.2; \>= 3.5.0, \< 3.5.6; \>= 3.4.0, \< 3.4.5; \>= 3.3.0, \< 3.3.7; \>= 3.0.0, \< 3.0.20

## Description

Issue summary: Applications using RSASVE key encapsulation to establish
a secret encryption key can send contents of an uninitialized memory buffer to
a malicious peer.

Impact summary: The uninitialized buffer might contain sensitive data from the
previous execution of the application process which leads to sensitive data
leakage to an attacker.

RSA\_public\_encrypt() returns the number of bytes written on success and -1
on error. The affected code tests only whether the return value is non-zero.
As a result, if RSA encryption fails, encapsulation can still return success to
the caller, set the output lengths, and leave the caller to use the contents of
the ciphertext buffer as if a valid KEM ciphertext had been produced.

If applications use EVP\_PKEY\_encapsulate() with RSA/RSASVE on an
attacker-supplied invalid RSA public key without first validating that key,
then this may cause stale or uninitialized contents of the caller-provided
ciphertext buffer to be disclosed to the attacker in place of the KEM
ciphertext.

As a workaround calling EVP\_PKEY\_public\_check() or
EVP\_PKEY\_public\_check\_quick() before EVP\_PKEY\_encapsulate() will mitigate
the issue.

The FIPS modules in 3.6, 3.5, 3.4, 3.3, 3.1 and 3.0 are affected by this issue.

## Affected and fixed versions

- OpenSSL: \>= 3.6.0, \< 3.6.2; \>= 3.5.0, \< 3.5.6; \>= 3.4.0, \< 3.4.5; \>= 3.3.0, \< 3.3.7; \>= 3.0.0, \< 3.0.20 (cvelist)

## Mitigation

- Upgrade OpenSSL to 3.0.20 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-31790.md
Affected: OpenSSL >= 3.6.0, < 3.6.2; >= 3.5.0, < 3.5.6; >= 3.4.0, < 3.4.5; >= 3.3.0, < 3.3.7; >= 3.0.0, < 3.0.20
Fixed in: OpenSSL 3.6.2, OpenSSL 3.5.6, OpenSSL 3.4.5, OpenSSL 3.3.7, OpenSSL 3.0.20

Steps:
1. Search this machine and project for 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-2026-31790 being exploited?

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

### How serious is CVE-2026-31790?

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

### Which versions are affected by CVE-2026-31790?

OpenSSL \>= 3.6.0, \< 3.6.2; \>= 3.5.0, \< 3.5.6; \>= 3.4.0, \< 3.4.5; \>= 3.3.0, \< 3.3.7; \>= 3.0.0, \< 3.0.20.

### Is there a fix for CVE-2026-31790?

Yes. Fixed in OpenSSL 3.6.2, OpenSSL 3.5.6, OpenSSL 3.4.5, OpenSSL 3.3.7, OpenSSL 3.0.20. Upgrade OpenSSL to 3.0.20 or later.

### How do I check if I'm affected by CVE-2026-31790?

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://openssl-library.org/news/secadv/20260407.txt>
- patch: <https://github.com/openssl/openssl/commit/abd8b2eec7e3f3fda60ecfb68498b246b52af482>
- patch: <https://github.com/openssl/openssl/commit/001e01db3e996e13ffc72386fe79d03a6683b5ac>
- patch: <https://github.com/openssl/openssl/commit/d5f8e71cd0a54e961d0c3b174348f8308486f790>
- patch: <https://github.com/openssl/openssl/commit/b922e24e5b23ffb9cb9e14cadff23d91e9f7e406>
- patch: <https://github.com/openssl/openssl/commit/eed200f58cd8645ed77e46b7e9f764e284df379e>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-032379.html>

## 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-2026-31790>

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