CVE-2021-3711: SM2 Decryption Buffer Overflow

Published Aug 19, 2021
·
Updated

A flaw was found in openssl. A miscalculation of a buffer size was found in openssl's SM2 decryption function, allowing up to 62 arbitrary bytes to be written outside of the buffer. A remote attacker could use this flaw to crash an application supporting SM2 signature or encryption algorithm, or, possibly, execute arbitrary code with the permissions of the user running that application. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.

Other sources

In order to decrypt SM2 encrypted data an application is expected to call the API function EVPPKEYdecrypt(). 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 EVPPKEYdecrypt() 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 EVPPKEYdecrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVPPKEYdecrypt() 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).

OpenSSL is vulnerable to a buffer overflow, caused by improper bounds checking by the EVPPKEYdecrypt() function within implementation of the SM2 decryption. By sending specially crafted SM2 content, a remote attacker could overflow a buffer and execute arbitrary code on the system or cause the application to crash.

IBM

Severity: High

In order to decrypt SM2 encrypted data an application is expected to call the API function EVPPKEYdecrypt(). 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 EVPPKEYdecrypt() 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 EVPPKEYdecrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVPPKEYdecrypt() 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.

OpenSSL versions 1.1.1k and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1l.

OpenSSL 1.0.2 is not impacted by this issue.

OpenSSL 3.0 alpha/beta releases are also affected but this issue will be addressed before the final release.

This issue was reported to OpenSSL on 12th August 2021 by John Ouyang. The fix was developed by Matt Caswell.

Red Hat

Affected Software

47 affected componentsFixes available
redhat/openssl<1.1.1
1.1.1
rust/openssl-src<111.16.0
111.16.0
OpenSSL OpenSSL>=1.1.1<1.1.1l
Debian Debian Linux=10.0
Debian Debian Linux=11.0
NetApp Active Iq Unified Manager Vmware Vsphere
NetApp Active Iq Unified Manager Windows
NetApp Clustered Data ONTAP
NetApp Clustered Data Ontap Antivirus Connector
NetApp E-Series SANtricity OS Controller>=11.0<=11.50.2
NetApp Hci Management Node
NetApp Manageability Software Development Kit
NetApp OnCommand Insight
NetApp OnCommand Workflow Automation
NetApp Santricity Smi-s Provider
NetApp Snapcenter
NetApp Solidfire
NetApp Storage Encryption
Oracle Communications Cloud Native Core Security Edge Protection Proxy=1.7.0
Oracle Communications Cloud Native Core Unified Data Repository=1.15.0
Oracle Communications Session Border Controller=8.4
Oracle Communications Session Border Controller=9.0
Oracle Communications Unified Session Manager=8.2.5
Oracle Communications Unified Session Manager=8.4.5
Oracle Enterprise Communications Broker=3.2.0
Oracle Enterprise Communications Broker=3.3.0
Oracle Enterprise Session Border Controller=8.4
Oracle Enterprise Session Border Controller=9.0
Oracle Essbase<11.1.2.4.47
Oracle Essbase>=21.1<21.3
Oracle Health Sciences Inform Publisher=6.2.1.1
Oracle Health Sciences Inform Publisher=6.3.1.1
Oracle JD Edwards EnterpriseOne Tools<9.2.6.3
Oracle Jd Edwards World Security=a9.4
Oracle MySQL Connectors<=8.0.27
Oracle MySQL Enterprise Monitor<=8.0.25
Oracle MySQL Server>=5.7.0<=5.7.35
Oracle MySQL Server>=8.0.0<=8.0.26
Oracle PeopleSoft Enterprise PeopleTools=8.57
Oracle PeopleSoft Enterprise PeopleTools=8.58
Oracle PeopleSoft Enterprise PeopleTools=8.59
Oracle ZFS Storage Appliance Kit=8.8
Tenable Nessus Network Monitor<=5.13.1
Tenable Tenable.Sc>=5.16.0<=5.19.1
debian/openssl
1.1.1w-0+deb11u11.1.1w-0+deb11u23.0.15-1~deb12u13.0.14-1~deb12u23.5.0-1
IBM Cognos Analytics 11.2.x<=IBM Cognos Analytics 11.2.x
IBM Cognos Analytics 11.1.x<=IBM Cognos Analytics 11.1.x

Event History

Aug 24, 2021
CVE Published
12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeakness
CVE Published
via MITRE·02:50 PM
Data Sourced
via MITRE·02:50 PM
DescriptionWeakness
May 24, 2022
Advisory Published
via GitHub·07:12 PM
Sep 18, 2024
Data Sourced
via Ubuntu·03:21 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·03:22 AM
Description
Feb 21, 2025
Data Sourced
via Debian·11:35 PM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the vulnerability ID for this OpenSSL vulnerability?

The vulnerability ID for this OpenSSL vulnerability is CVE-2021-3711.

2

What is the severity level of CVE-2021-3711?

CVE-2021-3711 has a severity level of critical.

3

Which software versions are affected by CVE-2021-3711?

CVE-2021-3711 affects OpenSSL versions 1.1.1 and earlier, IBM Cognos Analytics 11.2.x, IBM Cognos Analytics 11.1.x, and various other software products.

4

How can I fix this vulnerability?

To fix CVE-2021-3711, upgrade to OpenSSL version 1.1.1n or later.

5

Where can I find more information about CVE-2021-3711?

More information about CVE-2021-3711 can be found in the references: [link1](https://github.com/openssl/openssl/commit/59f5e75f3bced8fc0e130d72a3f582cf7b480b46), [link2](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=1997212), [link3](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=1997210).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203