SM2 Decryption Buffer Overflow
Summary
| CVE | CVE-2021-3711 |
|---|---|
| State | PUBLISHED |
| Assigner | openssl |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2021-08-24 15:15:09 UTC |
| Updated | 2026-10-08 21:17:40 UTC |
| 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). |
Risk And Classification
Primary CVSS: v3.1 9.8 CRITICAL from [email protected]
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Problem Types: CWE-120 | Buffer overflow
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | [email protected] | Primary | 9.8 | CRITICAL | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| 2.0 | [email protected] | Primary | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
LowPrivileges Required
NoneUser Interaction
NoneScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v2.0 Breakdown
Access Vector
NetworkAccess Complexity
LowAuthentication
NoneConfidentiality
PartialIntegrity
PartialAvailability
PartialAV:N/AC:L/Au:N/C:P/I:P/A:P
NVD Known Affected Configurations (CPE 2.3)
Vendor Declared Affected Products
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| Oracle Critical Patch Update Advisory - April 2022 | af854a3a-2127-422b-91ae-364da2661108 | www.oracle.com | Patch, Third Party Advisory |
| August 2021 OpenSSL Vulnerabilities in NetApp Products | NetApp Product Security | af854a3a-2127-422b-91ae-364da2661108 | security.netapp.com | Third Party Advisory |
| Oracle Critical Patch Update Advisory - October 2021 | af854a3a-2127-422b-91ae-364da2661108 | www.oracle.com | Patch, Third Party Advisory |
| October 2021 MySQL Server Vulnerabilities in NetApp Products | NetApp Product Security | af854a3a-2127-422b-91ae-364da2661108 | security.netapp.com | Third Party Advisory |
| [R1] Nessus Network Monitor 6.0.0 Fixes Multiple Third-party Vulnerabilities - Security Advisory | Tenable® | af854a3a-2127-422b-91ae-364da2661108 | www.tenable.com | Third Party Advisory |
| www.openssl.org/news/secadv/20210824.txt | af854a3a-2127-422b-91ae-364da2661108 | www.openssl.org | Vendor Advisory |
| [R1] Stand-alone Security Patch Available for Tenable.sc versions 5.16.0 to 5.19.1 - Security Advisory | Tenable® | af854a3a-2127-422b-91ae-364da2661108 | www.tenable.com | Third Party Advisory |
| OpenSSL: Multiple Vulnerabilities (GLSA 202210-02) — Gentoo security | af854a3a-2127-422b-91ae-364da2661108 | security.gentoo.org | Third Party Advisory |
| Oracle Critical Patch Update Advisory - January 2022 | af854a3a-2127-422b-91ae-364da2661108 | www.oracle.com | Patch, Third Party Advisory |
| security.netapp.com/advisory/ntap-20240621-0006 | af854a3a-2127-422b-91ae-364da2661108 | security.netapp.com | |
| lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e58... | af854a3a-2127-422b-91ae-364da2661108 | lists.apache.org | |
| git.openssl.org Git - openssl.git/commitdiff | af854a3a-2127-422b-91ae-364da2661108 | git.openssl.org | |
| oss-security - OpenSSL SM2 Decryption Buffer Overflow (CVE-2021-3711), Read buffer overruns processing ASN.1 strings (CVE-2021-3712) | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | Mailing List, Third Party Advisory |
| lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691... | af854a3a-2127-422b-91ae-364da2661108 | lists.apache.org | |
| IBM Spectrum Protect: Multiple Vulnerabilities (GLSA 202209-02) — Gentoo security | af854a3a-2127-422b-91ae-364da2661108 | security.gentoo.org | Third Party Advisory |
| cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf | af854a3a-2127-422b-91ae-364da2661108 | cert-portal.siemens.com | Third Party Advisory |
| Debian -- Security Information -- DSA-4963-1 openssl | af854a3a-2127-422b-91ae-364da2661108 | www.debian.org | Third Party Advisory |
| git.openssl.org Git - openssl.git/commitdiff | MITRE | git.openssl.org | |
| Pony Mail! | MITRE | lists.apache.org | |
| Pony Mail! | MITRE | lists.apache.org | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: John Ouyang (en)
Legacy QID Mappings
- 178774 Debian Security Update for Open Secure Sockets Layer (OpenSSL) (DSA 4963-1)
- 183872 Debian Security Update for Open Secure Sockets Layer (OpenSSL) (CVE-2021-3711)
- 198469 Ubuntu Security Notification for Open Secure Sockets Layer (OpenSSL) Vulnerabilities (USN-5051-1)
- 20236 Oracle MySQL October 2021 Critical Patch Update (CPU October 2021)
- 296061 Oracle Solaris 11.4 Support Repository Update (SRU) 42.113.1 Missing (CPUJAN2022)
- 376103 Open Secure Sockets Layer (OpenSSL) Security Update
- 376204 Mysql Workbench Critical Patch Update Oct 2021
- 376257 Oracle PeopleSoft Enterprise PeopleTools Product Multiple Vulnerabilities (CPUJAN2022)
- 376367 Oracle Essbase Administration Services Security Update (CPUJAN2022)
- 379452 IBM Cognos Analytics Multiple Vulnerabilities (7123154)
- 38855 Open Secure Sockets Layer (OpenSSL) Security Update (OpenSSL Security Advisory 20210824)
- 500499 Alpine Linux Security Update for Open Secure Sockets Layer (OpenSSL)
- 500567 Alpine Linux Security Update for Open Secure Sockets Layer (OpenSSL)
- 500766 Alpine Linux Security Update for openssl
- 501166 Alpine Linux Security Update for openssl
- 501985 Alpine Linux Security Update for Open Secure Sockets Layer3 (OpenSSL3)
- 502904 Alpine Linux Security Update for openssl1.1-compat
- 504258 Alpine Linux Security Update for openssl
- 505781 Alpine Linux Security Update for openssl1.1-compat
- 590870 Mitsubishi Electric MELSOFT iQ AppPortal Multiple Vulnerabilities (ICSA-22-132-02)
- 670831 EulerOS Security Update for Open Secure Sockets Layer (OpenSSL) (EulerOS-SA-2021-2717)
- 670993 EulerOS Security Update for Open Secure Sockets Layer111d (OpenSSL111d) (EulerOS-SA-2021-2668)
- 671015 EulerOS Security Update for Open Secure Sockets Layer (OpenSSL) (EulerOS-SA-2021-2692)
- 671019 EulerOS Security Update for Open Secure Sockets Layer (OpenSSL) (EulerOS-SA-2021-2639)
- 690055 Free Berkeley Software Distribution (FreeBSD) Security Update for Open Secure Sockets Layer (OpenSSL) (96811d4a-04ec-11ec-9b84-d4c9ef517024)
- 690192 Free Berkeley Software Distribution (FreeBSD) Security Update for mysql (c9387e4d-2f5f-11ec-8be6-d4c9ef517024)
- 710616 Gentoo Linux IBM Spectrum Protect Multiple Vulnerabilities (GLSA 202209-02)
- 710638 Gentoo Linux Open Secure Sockets Layer (OpenSSL) Multiple Vulnerabilities (GLSA 202210-02)
- 730206 McAfee Web Gateway Multiple Vulnerabilities (WP-3792, WP-4003, WP-4021, WP-4058, WP-4067)
- 751031 SUSE Enterprise Linux Security Update for Open Secure Sockets Layer (OpenSSL) (SUSE-SU-2021:2833-1)
- 751035 OpenSUSE Security Update for openssl-1_1 (openSUSE-SU-2021:2830-1)
- 751050 OpenSUSE Security Update for Open Secure Sockets Layer (OpenSSL) (openSUSE-SU-2021:1188-1)
- 752251 SUSE Enterprise Linux Security Update for SUSE Manager Client Tools (SUSE-SU-2022:2134-1)
- 752995 SUSE Enterprise Linux Security Update for grafana (SUSE-SU-2022:4428-1)
- 900333 Common Base Linux Mariner (CBL-Mariner) Security Update for Open Secure Sockets Layer (OpenSSL) (6005)
- 900910 Common Base Linux Mariner (CBL-Mariner) Security Update for Open Secure Sockets Layer (OpenSSL) (6779-1)
- 91831 Microsoft Visual Studio Security Update - November 2021