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

> Attackers can read uninitialized memory contents via RSA KEM encapsulation if invalid public keys are used without validation, leaking sensitive data.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Apr 2026
- **Updated:** 12 May 2026
- **Also known as:** ALPINE-CVE-2026-31790, ALSA-2026:19218, AZL-81950, BELL-CVE-2026-31790, CLSA-2026-1777948139, CLSA-2026-1778072039, DEBIAN-CVE-2026-31790, ECHO-cd1b-a137-2e06, GHSA-vgxx-5xj5-q97x, JLSEC-2026-277, MINI-83c3-pjwh-j63q, MINI-94m3-r75g-8f74, MINI-rhfj-8r8r-9755, OESA-2026-2161, OESA-2026-2602, RHSA-2026:19218, RHSA-2026:27744, RHSA-2026:27745, RHSA-2026:27746, RHSA-2026:28211, RHSA-2026:28832, RLSA-2026:19066, RLSA-2026:19218, ROOT-OS-ALPINE-317-CVE-2026-31790, UBUNTU-CVE-2026-31790

## What is CVE-2026-31790?

CVE-2026-31790 is a high-severity vulnerability in Openssl Openssl, published on 7 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-754 (Improper Check for Unusual or Exceptional Conditions)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openssl` | AlmaLinux:9 | All versions | 1:3.5.5-2.el9_8 |
| `openssl-devel` | AlmaLinux:9 | All versions | 1:3.5.5-2.el9_8 |
| `openssl-libs` | AlmaLinux:9 | All versions | 1:3.5.5-2.el9_8 |
| `openssl-perl` | AlmaLinux:9 | All versions | 1:3.5.5-2.el9_8 |
| `openssl-fips-provider` | Red Hat:enterprise_linux:10.2 | All versions | 0:3.0.7-11.el10_2 |
| `openssl-fips-provider-so` | Red Hat:enterprise_linux:10.2 | All versions | 0:3.0.7-11.el10_2 |
| `openssl-fips-provider-so-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:3.0.7-11.el10_2 |
| `openssl-fips-provider-so-debugsource` | Red Hat:enterprise_linux:10.2 | All versions | 0:3.0.7-11.el10_2 |
| `openssl-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:3.5.5-2.el9_8 |
| `openssl-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 1:3.5.5-2.el9_8 |
| `openssl-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 1:3.5.5-2.el9_8 |
| `openssl-libs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:3.5.5-2.el9_8 |
| `openssl-perl` | Red Hat:enterprise_linux:9::appstream | All versions | 1:3.5.5-2.el9_8 |
| `openssl` | Red Hat:enterprise_linux:9::baseos | All versions | 1:3.5.5-2.el9_8 |
| `openssl-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 1:3.5.5-2.el9_8 |
| `openssl-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 1:3.5.5-2.el9_8 |
| `openssl-fips-provider` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.0.7-11.el9_8 |
| `openssl-fips-provider-so` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.0.7-11.el9_8 |
| `openssl-fips-provider-so-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.0.7-11.el9_8 |
| `openssl-fips-provider-so-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.0.7-11.el9_8 |
| `openssl-libs` | Red Hat:enterprise_linux:9::baseos | All versions | 1:3.5.5-2.el9_8 |
| `openssl-libs-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 1:3.5.5-2.el9_8 |
| `openssl-fips-provider` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.0.7-11.el10_0 |
| `openssl-fips-provider-so` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.0.7-11.el10_0 |
| `openssl-fips-provider-so-debuginfo` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.0.7-11.el10_0 |
| `openssl-fips-provider-so-debugsource` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:3.0.7-11.el10_0 |
| `openssl-fips-provider` | Red Hat:hummingbird:1 | All versions | 0:3.0.7-1.2.hum1 |
| `openssl-fips-provider-so` | Red Hat:hummingbird:1 | All versions | 0:3.0.7-1.2.hum1 |
| `openssl-fips-provider` | Red Hat:rhel_e4s:9.2::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-debugsource` | Red Hat:rhel_e4s:9.2::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-so` | Red Hat:rhel_e4s:9.2::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-so-debuginfo` | Red Hat:rhel_e4s:9.2::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider` | Red Hat:rhel_e4s:9.4::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-debugsource` | Red Hat:rhel_e4s:9.4::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-so` | Red Hat:rhel_e4s:9.4::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-so-debuginfo` | Red Hat:rhel_e4s:9.4::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider` | Red Hat:rhel_eus:9.6::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-debugsource` | Red Hat:rhel_eus:9.6::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-so` | Red Hat:rhel_eus:9.6::baseos | All versions | 0:3.0.7-11.el9_0 |
| `openssl-fips-provider-so-debuginfo` | Red Hat:rhel_eus:9.6::baseos | All versions | 0:3.0.7-11.el9_0 |

Products: Openssl Openssl.

## How do I fix CVE-2026-31790?

Apply the vendor's patch.

## Is CVE-2026-31790 being exploited?

There is no known exploitation of CVE-2026-31790 in the wild and no public exploit code.

## Other vulnerabilities in Openssl Openssl

- [CVE-2009-3245](https://insights.sbomify.com/CVE-2009-3245/): Null dereference in n/a (critical 10.0)
- [CVE-2006-3738](https://insights.sbomify.com/CVE-2006-3738/): Memory corruption in n/a (critical 10.0)
- [CVE-2026-63073](https://insights.sbomify.com/CVE-2026-63073/): Untrusted Sender DN Used as Format String in CMP Response Validation (critical 9.8)
- [CVE-2016-6309](https://insights.sbomify.com/CVE-2016-6309/): Use after free in n/a (critical 9.8)
- [CVE-2016-0799](https://insights.sbomify.com/CVE-2016-0799/): Integer overflow in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-31790 and fix it if it is affected.

What it is: CVE-2026-31790 is a high-severity vulnerability in Openssl Openssl, published on 7 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-31790 in the wild and no public exploit code.

Affected product: Openssl Openssl. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-31790/ (Markdown: https://insights.sbomify.com/CVE-2026-31790/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-31790
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-31790
- OSV: https://osv.dev/vulnerability/CVE-2026-31790

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-31790/
Summaries are generated and may contain mistakes; the official description above is the record.
