CVEfocus › CVE database › CVE-2021-3711

CVE-2021-3711SM2 Decryption Buffer Overflow

CVSS 9.8 CriticalEPSS 88.6% (in the top 1% of all CVEs)Published 2021-08-24Updated 2026-10-08Assigner: openssl

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).

What to do

Likely to be exploited: EPSS gives a 89% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.

Fixed builds are available from Alpine, Debian, Ubuntu, crates.io: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

25Fixed
2Fix pending
30Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04edk2Not affected
vulnerable_code_not_present
Ubuntu 26.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 25.10edk2Not affected
vulnerable_code_not_present
Ubuntu 25.10nodejsNot affected
vulnerable_code_not_present
Ubuntu 24.04edk2Not affected
vulnerable_code_not_present
Ubuntu 24.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 22.04edk2Not affected
vulnerable_code_not_present
Ubuntu 22.04opensslFixed1.1.1l-1ubuntu1UBUNTU-CVE-2021-3711
Ubuntu 20.04opensslFixed1.1.1f-1ubuntu2.8UBUNTU-CVE-2021-3711
Ubuntu 18.04opensslFixed1.1.1-1ubuntu2.1~18.04.13UBUNTU-CVE-2021-3711
Ubuntu 16.04edk2Not affected
vulnerable_code_not_present
Ubuntu 16.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 16.04opensslFix pending
Ubuntu 14.04edk2Fix pending
Debian 14opensslFixed1.1.1l-1DEBIAN-CVE-2021-3711
Debian 13opensslFixed1.1.1l-1DEBIAN-CVE-2021-3711
Debian 12opensslFixed1.1.1l-1DEBIAN-CVE-2021-3711
Red Hat Enterprise Linux 9opensslNot affected
Red Hat Enterprise Linux 9openssl-develNot affected
Red Hat Enterprise Linux 9openssl-libsNot affected
Red Hat Enterprise Linux 9openssl-perlNot affected
Red Hat Enterprise Linux 8compat-openssl10Not affected
Red Hat Enterprise Linux 8opensslNot affected
Red Hat Enterprise Linux 8openssl-develNot affected
Red Hat Enterprise Linux 8openssl-libsNot affected
Red Hat Enterprise Linux 8openssl-perlNot affected
Red Hat Enterprise Linux 8openssl-staticNot affected
Red Hat Enterprise Linux 7opensslNot affected
Red Hat Enterprise Linux 7openssl-develNot affected
Red Hat Enterprise Linux 7openssl-libsNot affected
Red Hat Enterprise Linux 7openssl-perlNot affected
Red Hat Enterprise Linux 7openssl-staticNot affected
Red Hat Enterprise Linux 7openssl098eNot affected
Red Hat Enterprise Linux 6opensslNot affected
Red Hat Enterprise Linux 6openssl-develNot affected
Red Hat Enterprise Linux 6openssl-perlNot affected
Red Hat Enterprise Linux 6openssl-staticNot affected
Red Hat Enterprise Linux 6openssl098eNot affected
Alpine Linux 3.24opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.23opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.22opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.21opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.20opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.19opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.18opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.18openssl1.1-compatFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.17opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.17openssl1.1-compatFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.16opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.16openssl3Fixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.15opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.15openssl3Fixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.14opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.13opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.12opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
Alpine Linux 3.11opensslFixed1.1.1l-r0ALPINE-CVE-2021-3711
crates.io libraryopenssl-srcFixed111.16.0RUSTSEC-2021-0097

What the vendor says

As published in the CVE record by openssl, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.