CVE-2021-23840 — openssl-src
HIGHCVE-2021-23840 is a high-severity (CVSS 7.5) CWE-190 vulnerability in openssl-src. EPSS puts its 30-day exploitation probability at 50.7% (99th percentile). A fix is available for openssl-src — see the affected versions and patch details below.
Integer Overflow in openssl-src
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2021-23840.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-23840 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 385,386 CVEs with a current EPSS score, this one falls in the 50–90% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
openssl-srcReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
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).
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | openssl-src | all versions | 111.14.0cargo update -p openssl-src --precise 111.14.0 |
Affected Products
debian linuxdebianm10-1 firmwarefujitsum10-4 firmwarefujitsum10-4s firmwarefujitsum12-1 firmwarefujitsum12-2 firmwarefujitsuDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for openssl-src, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update openssl-src to 111.14.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-23840 is resolved across your whole dependency graph.
Workarounds
Constrain what reaches the vulnerable code: limit the size and shape of untrusted input, isolate the affected component in a sandboxed or least-privileged process, and enable the platform's memory-safety mitigations (ASLR, stack protector, hardened allocator) so an out-of-bounds access is more likely to fail closed than to be exploitable.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This flaw only affects applications which are compiled with OpenSSL and using EVP_CipherUpdate, EVP_EncryptUpdate or EVP_DecryptUpdate functions. When specially-crafted values are passed to these functions, it can cause the application to crash or behave incorrectly. OpenSSL in Red Hat Enterprise Linux 9 was marked…
| Product | Fixed in | Advisory |
|---|---|---|
| JBoss Core Services for RHEL 8 | jbcs-httpd24-apr-0:1.6.3-107.el8jbcs | RHSA-2021:4614 |
| Red Hat Enterprise Linux 7 | openssl-1:1.0.2k-22.el7_9 | RHSA-2021:3798 |
| Red Hat Enterprise Linux 8 | edk2-0:20210527gite1999b264f1f-3.el8 | RHSA-2021:4198 |
| Red Hat Enterprise Linux 8 | openssl-1:1.1.1k-4.el8 | RHSA-2021:4424 |
| Red Hat JBoss Core Services | openssl | RHSA-2021:4613 |
| Red Hat JBoss Web Server 5 | see advisory | RHSA-2021:4863 |
| Red Hat JBoss Web Server 5.6 on RHEL 7 | jws5-tomcat-0:9.0.50-3.redhat_00004.1.el7jws | RHSA-2021:4861 |
Frequently Asked Questions
Is CVE-2021-23840 in your dependencies?
Find it across crates.io, including transitive dependencies.