CVE-2021-3711SM2 Decryption Buffer Overflow
- 9.8CriticalCVSS base score
- 87.8%Exploitation in 30 daysEPSS · top 0.2% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
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).
Timeline
ID reserved
By openssl
- 8 days later
· 8 days later
Published
- 5 years later
· 5 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 3.1 | Critical9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 87.8% · top 0.2% of all CVEs (16 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: yes · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: Critical 9.8.
Affected products
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- crates.ioopenssl-srcGHSA-5ww6-px42-wc85 (opens in a new tab)
References
References17
- https://www.openssl.org/news/secadv/20210824.txt (opens in a new tab)x_transferred
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=59f5e75f3bced8fc0e130d72a3f582cf7b480b46 (opens in a new tab)x_transferred
- DSA-4963 (opens in a new tab)vendor-advisoryx_transferred
- [tomcat-dev] 20210825 OpenSSL security announcement - do we need a Tomcat Native release? (opens in a new tab)mailing-listx_transferred
- [oss-security] 20210825 OpenSSL SM2 Decryption Buffer Overflow (CVE-2021-3711), Read buffer overruns processing ASN.1 strings (CVE-2021-3712) (opens in a new tab)mailing-listx_transferred
- [tomcat-dev] 20210826 Re: OpenSSL security announcement - do we need a Tomcat Native release? (opens in a new tab)mailing-listx_transferred
- https://security.netapp.com/advisory/ntap-20210827-0010/ (opens in a new tab)x_transferred
- https://www.oracle.com/security-alerts/cpuoct2021.html (opens in a new tab)x_transferred
- https://www.tenable.com/security/tns-2021-16 (opens in a new tab)x_transferred
- https://www.oracle.com/security-alerts/cpujan2022.html (opens in a new tab)x_transferred
- https://security.netapp.com/advisory/ntap-20211022-0003/ (opens in a new tab)x_transferred
- https://www.tenable.com/security/tns-2022-02 (opens in a new tab)x_transferred
- https://www.oracle.com/security-alerts/cpuapr2022.html (opens in a new tab)x_transferred
- https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf (opens in a new tab)x_transferred
- GLSA-202209-02 (opens in a new tab)vendor-advisoryx_transferred
- GLSA-202210-02 (opens in a new tab)vendor-advisoryx_transferred
- https://security.netapp.com/advisory/ntap-20240621-0006/ (opens in a new tab)x_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2022-2673 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-5ww6-px42-wc85 (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-3711)Record last updated .