Vulnerability record · CVE-2021-23840 · published 16 February 2021
CVE-2021-23840: OpenSSL EVP cipher update integer overflow causes negative output length
OOpenssl · Openssl
Calls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate can overflow the output length argument when the input length approaches the platform's maximum integer value. The function returns success (1) while the output length becomes negative, so applications may behave incorrectly or crash. OpenSSL 1.1.1i and earlier and 1.0.2x and earlier are affected; fixes are in 1.1.1j and 1.0.2y.
Description
Calls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate may overflow the output length argument in some cases where the input length is close to the maximum permissable length for an integer on the platform. In such cases the return value from the function call will be 1 (indicating success), but the output length value will be negative. This could cause applications to behave incorrectly or crash. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x).
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Automated analysis
high priorityCVSS 7.5 with network reachability and high EPSS, but no KEV listing or documented exploitation and impact limited to availability.
What it is
Calls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate can overflow the output length argument when the input length approaches the platform's maximum integer value. The function returns success (1) while the output length becomes negative, so applications may behave incorrectly or crash. OpenSSL 1.1.1i and earlier and 1.0.2x and earlier are affected; fixes are in 1.1.1j and 1.0.2y.
Impact
An attacker who can drive very large input lengths into affected EVP calls can trigger incorrect application behavior or a crash, giving a denial of service. The CVSS vector shows no confidentiality or integrity impact, only availability.
Attack surface
Reachable over the network per the CVSS vector (AV:N) with no privileges or user interaction required, but only where an application passes near-maximum input lengths into the affected EVP update functions. The record does not identify specific exposed services or protocols.
Exploitation
Not listed in CISA KEV and no ransomware usage is documented. EPSS is high (about 0.51 probability, 98.9th percentile), and references are vendor and third-party advisories plus patch commits, with no public exploit tag.
What to do
- Upgrade OpenSSL to 1.1.1j or later; 1.0.2 users must move to 1.0.2y (premium support) or 1.1.1j.
- Inventory and update downstream products that bundle OpenSSL, including Debian, Oracle, Tenable, McAfee, Fujitsu and Node.js components listed in the record.
- Apply vendor advisories and patches referenced for affected products rather than relying on OpenSSL upgrades alone.
- Where immediate patching is not possible, review applications that pass very large buffers to EVP_CipherUpdate, EVP_EncryptUpdate or EVP_DecryptUpdate and add input length bounds checks.
Detection
- Monitor application and service logs for crashes or abnormal terminations in processes using OpenSSL EVP encryption or decryption routines.
- Track OpenSSL library versions across hosts and containers to find systems still on 1.1.1i or earlier or 1.0.2x or earlier.
- Watch for unusually large input sizes or memory allocation failures in services that perform bulk encryption or decryption.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
21 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2021-23840 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2021-23840), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.