CVE-2021-23840
📋 TL;DR
This OpenSSL vulnerability involves integer overflow in cryptographic functions (EVP_CipherUpdate, EVP_EncryptUpdate, EVP_DecryptUpdate) when processing input near maximum permissible length. The overflow causes incorrect negative output length values while returning success, potentially leading to application crashes or incorrect behavior. Affected users include those running OpenSSL 1.1.1i and below, or OpenSSL 1.0.2x and below (which is out of public support).
💻 Affected Systems
- OpenSSL
📦 What is this software?
Communications Cloud Native Core Policy by Oracle
View all CVEs affecting Communications Cloud Native Core Policy →
Enterprise Manager For Storage Management by Oracle
View all CVEs affecting Enterprise Manager For Storage Management →
Graalvm by Oracle
Graalvm by Oracle
Graalvm by Oracle
Node.js by Nodejs
Node.js by Nodejs
Node.js by Nodejs
Node.js by Nodejs
Node.js by Nodejs
Node.js by Nodejs
Node.js by Nodejs
Openssl by Openssl
OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.
Learn more about Openssl →Openssl by Openssl
OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.
Learn more about Openssl →⚠️ Risk & Real-World Impact
Worst Case
Application crashes leading to denial of service, potential memory corruption that could enable remote code execution in specific application contexts.
Likely Case
Application crashes or incorrect cryptographic operations causing service disruption and potential data integrity issues.
If Mitigated
Minimal impact with proper input validation and length checking in application code, though underlying vulnerability remains.
🎯 Exploit Status
Exploitation requires crafting specific input lengths to trigger the integer overflow. While unauthenticated exploitation is possible, the specific conditions needed make widespread weaponization less likely.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: OpenSSL 1.1.1j or OpenSSL 1.0.2y (for premium support customers only)
Vendor Advisory: https://www.openssl.org/news/secadv/20210216.txt
Restart Required: Yes
Instructions:
1. Identify OpenSSL version using 'openssl version'. 2. For OpenSSL 1.1.1i or below: upgrade to 1.1.1j via package manager (apt-get upgrade openssl, yum update openssl, etc.). 3. For OpenSSL 1.0.2x or below: upgrade to 1.1.1j (recommended) or 1.0.2y (premium support only). 4. Restart all services using OpenSSL.
🔧 Temporary Workarounds
Input length validation
allImplement application-level validation to ensure input lengths to EVP functions stay well below maximum permissible values
Memory limit restrictions
allConfigure memory limits to prevent allocation of buffers near maximum integer size
🧯 If You Can't Patch
- Implement strict input validation in application code to reject inputs near maximum permissible lengths
- Deploy network segmentation and monitoring to detect potential exploitation attempts
🔍 How to Verify
Check if Vulnerable:
Run 'openssl version' and check if version is 1.1.1i or below, or 1.0.2x or below
Check Version:
openssl version
Verify Fix Applied:
After patching, run 'openssl version' to confirm version is 1.1.1j or higher (or 1.0.2y for premium support)
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults in OpenSSL cryptographic functions
- Unexpected negative length values in cryptographic operation logs
Network Indicators:
- Unusual large input sizes to cryptographic services
- Service disruption patterns following large data transfers
SIEM Query:
source="*openssl*" AND ("segmentation fault" OR "negative length" OR "EVP_CipherUpdate" OR "EVP_EncryptUpdate" OR "EVP_DecryptUpdate")
🔗 References
- https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=6a51b9e1d0cf0bf8515f7201b68fb0a3482b3dc1
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=9b1129239f3ebb1d1c98ce9ed41d5c9476c47cb2
- https://kb.pulsesecure.net/articles/Pulse_Security_Advisories/SA44846
- https://kc.mcafee.com/corporate/index?page=content&id=SB10366
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E
- https://security.gentoo.org/glsa/202103-03
- https://security.netapp.com/advisory/ntap-20210219-0009/
- https://security.netapp.com/advisory/ntap-20240621-0006/
- https://www.debian.org/security/2021/dsa-4855
- https://www.openssl.org/news/secadv/20210216.txt
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.oracle.com/security-alerts/cpuApr2021.html
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://www.tenable.com/security/tns-2021-03
- https://www.tenable.com/security/tns-2021-09
- https://www.tenable.com/security/tns-2021-10
- https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=6a51b9e1d0cf0bf8515f7201b68fb0a3482b3dc1
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=9b1129239f3ebb1d1c98ce9ed41d5c9476c47cb2
- https://kb.pulsesecure.net/articles/Pulse_Security_Advisories/SA44846
- https://kc.mcafee.com/corporate/index?page=content&id=SB10366
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E
- https://security.gentoo.org/glsa/202103-03
- https://security.netapp.com/advisory/ntap-20210219-0009/
- https://security.netapp.com/advisory/ntap-20240621-0006/
- https://www.debian.org/security/2021/dsa-4855
- https://www.openssl.org/news/secadv/20210216.txt
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.oracle.com/security-alerts/cpuApr2021.html
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://www.tenable.com/security/tns-2021-03
- https://www.tenable.com/security/tns-2021-09
- https://www.tenable.com/security/tns-2021-10