--- title: "CVE-2021-3711: SM2 Decryption Buffer Overflow | CubePath" 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…" language: en source: https://cubepath.com/security/cve/CVE-2021-3711 --- # CVE-2021-3711: SM2 Decryption Buffer Overflow | CubePath ## 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). Official description from the CVE record, published by openssl. Copyright © 1999-2026 The MITRE Corporation. See [/security/cve/legal](https://cubepath.com/security/cve/legal) for the CVE license. [View the record on cve.org](https://www.cve.org/CVERecord?id=CVE-2021-3711) ## Key data ### EPSS Exploit Prediction Scoring System by FIRST: an estimate of the probability that exploitation activity will be observed in the next 30 days. Score 0.87816 (87.8% probability) Percentile 99.8% Scores of Nov 10, 2026 Model v2026.06.15 ### CISA assessment as of Oct 8, 2026 Stakeholder-Specific Vulnerability Categorization (SSVC) decision points added by CISA. Automatable yes Technical impact total ## Affected products Products listed in the CVE record, as the CNA published them. - OpenSSL - affected: Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k) ## References Links listed in the CVE record. They lead to other sites, which CubePath does not control. - [openssl.org/news/secadv/20210824.txt](https://www.openssl.org/news/secadv/20210824.txt) - [git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=59…](https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=59f5e75f3bced8fc0e130d72a3f582cf7b480b46) - [DSA-4963](https://www.debian.org/security/2021/dsa-4963) (debian.org) vendor-advisory - [\[tomcat-dev\] 20210825 OpenSSL security announcement - do we need a Tomcat Native release?](https://lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691e7c59c9e%40%3Cdev.tomcat.apache.org%3E) (lists.apache.org) mailing-list - [\[oss-security\] 20210825 OpenSSL SM2 Decryption Buffer Overflow (CVE-2021-3711), Read buffer overruns processing ASN.1 strings (CVE-2021-3712)](http://www.openwall.com/lists/oss-security/2021/08/26/2) (openwall.com) mailing-list - [\[tomcat-dev\] 20210826 Re: OpenSSL security announcement - do we need a Tomcat Native release?](https://lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e5805a713d1%40%3Cdev.tomcat.apache.org%3E) (lists.apache.org) mailing-list - [security.netapp.com/advisory/ntap-20210827-0010](https://security.netapp.com/advisory/ntap-20210827-0010/) - [oracle.com/security-alerts/cpuoct2021.html](https://www.oracle.com/security-alerts/cpuoct2021.html) - [tenable.com/security/tns-2021-16](https://www.tenable.com/security/tns-2021-16) - [oracle.com/security-alerts/cpujan2022.html](https://www.oracle.com/security-alerts/cpujan2022.html) - [security.netapp.com/advisory/ntap-20211022-0003](https://security.netapp.com/advisory/ntap-20211022-0003/) - [tenable.com/security/tns-2022-02](https://www.tenable.com/security/tns-2022-02) - [oracle.com/security-alerts/cpuapr2022.html](https://www.oracle.com/security-alerts/cpuapr2022.html) - [cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf](https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf) - [GLSA-202209-02](https://security.gentoo.org/glsa/202209-02) (security.gentoo.org) vendor-advisory - [GLSA-202210-02](https://security.gentoo.org/glsa/202210-02) (security.gentoo.org) vendor-advisory - [security.netapp.com/advisory/ntap-20240621-0006](https://security.netapp.com/advisory/ntap-20240621-0006/) ## Timeline 1. ID reserved Aug 16, 2021 2. Record published Aug 24, 2021 3. Record last updated Oct 8, 2026 ## Look up another CVE ## About CubePath CubePath is a cloud provider with data centers in Europe and the United States. It offers VPS, bare metal servers and DDoS protection. [Cloud VPS](https://cubepath.com/vps) [DDoS protection](https://cubepath.com/ddos-protection) Data from the CVE Program (MITRE), CISA KEV and FIRST EPSS. CVSS is owned by FIRST and used by permission. Not affiliated with or endorsed by MITRE, CISA or FIRST. Data as of Nov 10, 2026, 20:04 UTC. [Sources and licenses](https://cubepath.com/security/cve/legal)