Skip to content
Noroxi
CVE-2021-3711· NVD / CVE Program· CNA openssl

SM2 Decryption Buffer Overflow

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

CriticalCVSS 9.8 · v3.1—No exploit Fix available
Published
Aug 24, 2021
Updated
Jun 17, 2026
EPSS
87.8% · 100th percentile
Follow this CVE

Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.

Report tools

JSON

Action score

65

This week

Don’t wait for the next maintenance window.

CVSS
39 / 40 · 9.8 / 10
CISA KEV
0 / 30 · Not listed
EPSS
26 / 30 · 87.8%

Affected systems

VendorProduct
opensslopenssl
debiandebian linux
netappactive iq unified manager
netappclustered data ontap
netappclustered data ontap antivirus connector
netappe-series santricity os controller
netapphci management node
netappmanageability software development kit
netapponcommand insight
netapponcommand workflow automation
netappsantricity smi-s provider
netappsnapcenter

and 19 more

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • oracle mysql server5.7.0 and later · up to 5.7.35 inclusive
  • oracle mysql server8.0.0 and later · up to 8.0.26 inclusive

Versions reported by the vendor

Affected version ranges reported by the assigning authority (openssl). Independent of NVD's CPE analysis and usually ahead of it.

  • OpenSSL OpenSSL

    • Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k)affected

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
Alpine:v3.11opensslfrom 1.1.1 · before 1.1.1l-r01.1.1l-r0
Alpine:v3.15openssl3before 1.1.1l-r01.1.1l-r0
crates.ioopenssl-srcfrom 0.0.0-0 · before 111.16.0111.16.0
crates.ioopenssl-srcbefore 111.16.0111.16.0
Debian:10opensslbefore 1.1.1d-0+deb10u71.1.1d-0+deb10u7
Debian:11opensslbefore 1.1.1k-1+deb11u11.1.1k-1+deb11u1
Debian:12opensslbefore 1.1.1l-11.1.1l-1
openSUSE:Leap 15.2openssl-1_1before 1.1.1d-lp152.7.21.11.1.1d-lp152.7.21.1
openSUSE:Leap 15.3golang-github-prometheus-promubefore 0.13.0-150000.3.9.10.13.0-150000.3.9.1
openSUSE:Leap 15.3grafanabefore 8.3.5-150200.3.21.18.3.5-150200.3.21.1
openSUSE:Leap 15.3openssl-1_1before 1.1.1d-11.27.11.1.1d-11.27.1
openSUSE:Leap 15.4wirebefore 0.5.0-150000.1.9.30.5.0-150000.1.9.3
openSUSE:Tumbleweedgrafanabefore 8.3.4-1.18.3.4-1.1
openSUSE:Tumbleweedgrypebefore 0.92.1-1.10.92.1-1.1
SUSE:Enterprise Storage 6grafanabefore 8.5.13-150100.3.12.18.5.13-150100.3.12.1
SUSE:HPE Helion OpenStack 8golang-github-prometheus-node_exporterbefore 1.3.0-1.15.31.3.0-1.15.3
SUSE:Linux Enterprise Module for Basesystem 15 SP2openssl-1_1before 1.1.1d-11.27.11.1.1d-11.27.1
SUSE:Linux Enterprise Module for Package Hub 15 SP4grafanabefore 8.5.13-150200.3.29.58.5.13-150200.3.29.5
SUSE:Linux Enterprise Module for Package Hub 15 SP4grafanabefore 8.5.13-150200.3.29.58.5.13-150200.3.29.5
SUSE:Manager Client Tools 12golang-github-boynux-squid_exporterbefore 1.6-1.9.11.6-1.9.1
SUSE:Manager Client Tools 12golang-github-prometheus-alertmanagerbefore 0.23.0-1.12.30.23.0-1.12.3
SUSE:Manager Client Tools 12golang-github-QubitProducts-exporter_exporterbefore 0.4.0-1.6.10.4.0-1.6.1
SUSE:Manager Client Tools 12grafanabefore 8.3.5-1.30.38.3.5-1.30.3
SUSE:Manager Client Tools 12grafanabefore 8.5.13-1.36.28.5.13-1.36.2

+96

Other highest-scoring records for the same primary product.

  • CVE-2014-0160The (1) TLS and (2) DTLS implementations in OpenSSL 1.0.1 before 1.0.1g do not properly handle Heartbeat Extension packets, which allows remKEV
    90Now
  • CVE-2003-0545Double free vulnerability in OpenSSL 0.9.7 allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code
    65This week
  • CVE-2016-2108The ASN.1 implementation in OpenSSL before 1.0.1o and 1.0.2 before 1.0.2c allows remote attackers to execute arbitrary code or cause a denia
    62This week
  • CVE-2016-6309statem/statem.c in OpenSSL 1.1.0a does not consider memory-block movement after a realloc call, which allows remote attackers to cause a den
    60This week
  • CVE-2022-3786X.509 Email Address Variable Length Buffer Overflow
    58Plan
  • CVE-2022-2068The c_rehash script allows command injection
    58Plan

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
Alpine:openssl1.1.1l-r0 · Alpine:v3.11Package registry (OSV)
Alpine:openssl31.1.1l-r0 · Alpine:v3.15Package registry (OSV)
crates.io:openssl-src111.16.0Package registry (OSV)
Debian:openssl1.1.1l-1 · Debian:12Package registry (OSV)
openSUSE:grafana8.3.5-150200.3.21.1 · openSUSE:Leap 15.3Package registry (OSV)
SUSE:grafana8.3.5-150000.1.30.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:mgr-cfg4.2.8-150000.1.24.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:mgr-osad4.2.8-150000.1.36.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:mgr-push4.2.5-150000.1.18.2 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:mgr-virtualization4.2.4-150000.1.26.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:openssl-1_11.1.1d-11.27.1 · SUSE:Linux Enterprise Module for Basesystem 15 SP2Package registry (OSV)
SUSE:prometheus-postgres_exporter0.10.0-150000.1.3.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:rhnlib4.2.6-150000.3.34.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:spacecmd4.2.16-150000.3.77.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:spacewalk-client-tools4.2.18-150000.3.59.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:spacewalk-koan4.2.6-150000.3.27.1 · SUSE:Manager Client Tools 15Package registry (OSV)
SUSE:spacewalk-oscap4.2.4-150000.3.18.1 · SUSE:Manager Client Tools 15Package registry (OSV)

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

EPSS, last 120 days

FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

No commit or PR link among the references.

Finders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.

Variant candidates

Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.

No nightly-computed relations.

Chain candidates

An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.

—

Bug bounty scope

The product’s vendor appears in a public program. Matched by name; verify the scope text in the program.

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • No user action is required.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
high · data can be read
Integrity
high · data or configuration can be modified
Availability
high · the service can be disrupted
Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality impact
High
Integrity impact
High
Availability impact
High

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

nvd-primary

Root cause

When data is copied, the source length is not compared with the size of the destination buffer. Excess data overwrites adjacent memory.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

c
char buf[256];memcpy(buf, pkt->data, pkt->len);

Fixed

c
char buf[256];if (pkt->len > sizeof(buf)) {  return -EINVAL;}memcpy(buf, pkt->data, pkt->len);

Noroxi analysis

No Noroxi analysis for this record yet

We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.

We use this product, ask for help

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records