CVE-2026-31790: Incorrect Failure Handling in RSA KEM RSASVE Encapsulation
Incorrect Failure Handling in RSA KEM RSASVE Encapsulation
Other sources
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.
RSApublicencrypt() 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 EVPPKEYencapsulate() 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 EVPPKEYpubliccheck() or EVPPKEYpubliccheckquick() before EVPPKEYencapsulate() 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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
As a workaround, call EVP_PKEY_public_check() or EVP_PKEY_public_check_quick() before EVP_PKEY_encapsulate() when using RSASVE key encapsulation to mitigate incorrect failure handling that can disclose uninitialized ciphertext buffer contents.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31790?
CVE-2026-31790 has a high severity due to its ability to expose sensitive memory content.
How do I fix CVE-2026-31790?
To fix CVE-2026-31790, update to a version of OpenSSL that is not affected by this vulnerability.
What applications are affected by CVE-2026-31790?
CVE-2026-31790 affects applications using RSA KEM RSASVE key encapsulation in OpenSSL versions between 3.0.0 and 3.6.2.
What is the impact of CVE-2026-31790?
The impact of CVE-2026-31790 includes the potential for a malicious peer to receive contents of an uninitialized memory buffer.
Is CVE-2026-31790 related to any specific OpenSSL versions?
Yes, CVE-2026-31790 specifically impacts OpenSSL versions from 3.0.0 to 3.6.2.