CVE-2021-3711
SM2 Decryption Buffer Overflow
Check your servers for CVE-2021-3711
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-3711 affects openssl, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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).
Exploitation
EPSS 88.5%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 99.7% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 8 Oct 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- total: full control of the component or of its data
Affected products
As the CNA lists them.
Is my server affected?
Find the installed version of openssl and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i openssl
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-3711 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-3711RHEL, Rocky, Alma, Fedora
rpm -q openssl
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-3711Alpine
apk list --installed | grep -i opensslWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2021-3711
trivy image --scanners vuln IMAGE | grep CVE-2021-3711
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- DSA-4963 debian.org · vendor advisory
- GLSA-202209-02 security.gentoo.org · vendor advisory
- GLSA-202210-02 security.gentoo.org · vendor advisory
Other references
- https://www.openssl.org/news/secadv/20210824.txt openssl.org
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=59f5e75f3bced8fc0e130d72a3f582cf7b480b46 git.openssl.org
- [tomcat-dev] 20210825 OpenSSL security announcement - do we need a Tomcat Native release? lists.apache.org · mailing list
- [oss-security] 20210825 OpenSSL SM2 Decryption Buffer Overflow (CVE-2021-3711), Read buffer overruns processing… openwall.com · mailing list
- [tomcat-dev] 20210826 Re: OpenSSL security announcement - do we need a Tomcat Native release? lists.apache.org · mailing list
- https://security.netapp.com/advisory/ntap-20210827-0010/ security.netapp.com
- https://www.oracle.com/security-alerts/cpuoct2021.html oracle.com
- https://www.tenable.com/security/tns-2021-16 tenable.com
- https://www.oracle.com/security-alerts/cpujan2022.html oracle.com
- https://security.netapp.com/advisory/ntap-20211022-0003/ security.netapp.com
- https://www.tenable.com/security/tns-2022-02 tenable.com
- https://www.oracle.com/security-alerts/cpuapr2022.html oracle.com
- https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf cert-portal.siemens.com
- https://security.netapp.com/advisory/ntap-20240621-0006/ security.netapp.com
Source: the record CVE-2021-3711 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse