← Vulnerability feed

Vulnerability record · CVE-2021-3711 · published 24 August 2021

CVE-2021-3711: OpenSSL SM2 decryption buffer overflow

OOpenssl · Openssl

OpenSSL's SM2 decryption code miscalculates the output buffer size needed by EVP_PKEY_decrypt(), so the first sizing call can return a value smaller than the plaintext actually produced on the second call. An application that allocates based on that first call then passes a too-small buffer, and the subsequent write overflows it by up to 62 bytes. This affects OpenSSL 1.1.1 through 1.1.1k and is fixed in 1.1.1l.

9.8 CVSS 3.1 Critical EPSS 88% · top 0.2% CWE-120 · Classic buffer overflow
9.8CVSS 3.1 base score, v2 7.5
88%EPSS exploitation probability, 30 days
NoNot in CISA KEV
31Affected product versions listed by NVD
34References
17 Jun 2026Last modified by NVD

Description

In order to decrypt SM2 encrypted data an application is expected to call the API function EVP_PKEY_decrypt(). Typically an application will call this function twice. The first time, on entry, the "out" parameter can be NULL and, on exit, the "outlen" parameter is populated with the buffer size required to hold the decrypted plaintext. The application can then allocate a sufficiently sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL value for the "out" parameter. A bug in the implementation of the SM2 decryption code means that the calculation of the buffer size required to hold the plaintext returned by the first call to EVP_PKEY_decrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is called by the application a second time with a buffer that is too small. A malicious attacker who is able present SM2 content for decryption to an application could cause attacker chosen data to overflow the buffer by up to a maximum of 62 bytes altering the contents of other data held after the buffer, possibly changing application behaviour or causing the application to crash. The location of the buffer is application dependent but is typically heap allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k).

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

critical priorityCVSS 9.8 with network reachability, no authentication or interaction, and a very high EPSS score make this a top patching priority despite no KEV listing.

What it is

OpenSSL's SM2 decryption code miscalculates the output buffer size needed by EVP_PKEY_decrypt(), so the first sizing call can return a value smaller than the plaintext actually produced on the second call. An application that allocates based on that first call then passes a too-small buffer, and the subsequent write overflows it by up to 62 bytes. This affects OpenSSL 1.1.1 through 1.1.1k and is fixed in 1.1.1l.

Impact

An attacker who can supply SM2 ciphertext for decryption can overwrite up to 62 bytes past a typically heap-allocated buffer, corrupting adjacent data, altering application behavior, or crashing the process. The CVSS vector rates confidentiality, integrity and availability all High, though the record does not demonstrate code execution.

Attack surface

Reached remotely over the network with no authentication and no user interaction (CVSS:3.1/AV:N/AC:L/PR:N/UI:N), but only where an application actually performs SM2 decryption on attacker-supplied content. Applications that never call EVP_PKEY_decrypt() with SM2 keys are not exposed.

Exploitation

Not listed in CISA KEV and no ransomware use is documented, but EPSS is very high at 0.878 (99.75th percentile), indicating strong predicted exploitation pressure. References are advisories and patches only; none are tagged as exploit code.

What to do

  • Upgrade OpenSSL to 1.1.1l or later, or apply the vendor patch for your distribution or product.
  • Apply the linked vendor advisories for NetApp, Oracle, Debian, Gentoo, Siemens and Tenable products that bundle OpenSSL.
  • If immediate patching is not possible, disable or avoid SM2 decryption paths that process untrusted ciphertext.
  • Inventory applications and services that call EVP_PKEY_decrypt() with SM2 keys and prioritize them for patching.

Detection

  • Search hosts and containers for OpenSSL versions 1.1.1 through 1.1.1k, including statically linked and bundled copies.
  • Monitor for crashes or abnormal terminations in processes that perform SM2 decryption on external input.
  • Watch for unexpected heap corruption indicators or memory errors in services handling SM2-encrypted data.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

31 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://www.openwall.com/lists/oss-security/2021/08/26/2 Mailing ListThird Party Advisory
https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf Third Party Advisory
https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=59f5e75f3bced8fc0e130d72a3f582cf7b480b46
https://lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691e7c59c9e%40%3Cdev.tomcat.apache.or
https://lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e5805a713d1%40%3Cdev.tomcat.apache.or
https://security.gentoo.org/glsa/202209-02 Third Party Advisory
https://security.gentoo.org/glsa/202210-02 Third Party Advisory
https://security.netapp.com/advisory/ntap-20210827-0010/ Third Party Advisory
https://security.netapp.com/advisory/ntap-20211022-0003/ Third Party Advisory
https://security.netapp.com/advisory/ntap-20240621-0006/
https://www.debian.org/security/2021/dsa-4963 Third Party Advisory
https://www.openssl.org/news/secadv/20210824.txt Vendor Advisory
https://www.oracle.com/security-alerts/cpuapr2022.html PatchThird Party Advisory
https://www.oracle.com/security-alerts/cpujan2022.html PatchThird Party Advisory
https://www.oracle.com/security-alerts/cpuoct2021.html PatchThird Party Advisory
https://www.tenable.com/security/tns-2021-16 Third Party Advisory
https://www.tenable.com/security/tns-2022-02 Third Party Advisory
http://www.openwall.com/lists/oss-security/2021/08/26/2 Mailing ListThird Party Advisory
https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf Third Party Advisory
https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=59f5e75f3bced8fc0e130d72a3f582cf7b480b46
https://lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691e7c59c9e%40%3Cdev.tomcat.apache.or
https://lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e5805a713d1%40%3Cdev.tomcat.apache.or
https://security.gentoo.org/glsa/202209-02 Third Party Advisory
https://security.gentoo.org/glsa/202210-02 Third Party Advisory
https://security.netapp.com/advisory/ntap-20210827-0010/ Third Party Advisory
https://security.netapp.com/advisory/ntap-20211022-0003/ Third Party Advisory
https://security.netapp.com/advisory/ntap-20240621-0006/
https://www.debian.org/security/2021/dsa-4963 Third Party Advisory
https://www.openssl.org/news/secadv/20210824.txt Vendor Advisory
https://www.oracle.com/security-alerts/cpuapr2022.html PatchThird Party Advisory
https://www.oracle.com/security-alerts/cpujan2022.html PatchThird Party Advisory
https://www.oracle.com/security-alerts/cpuoct2021.html PatchThird Party Advisory
https://www.tenable.com/security/tns-2021-16 Third Party Advisory
https://www.tenable.com/security/tns-2022-02 Third Party Advisory

Track CVE-2021-3711 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.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2023-46604Apache ActiveMQ OpenWire deserialization remote code executionThe Java OpenWire protocol marshaller in Apache ActiveMQ deserializes untrusted data, letting an attacker manipulate serialized class types so the br…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2021-3711), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.