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).
- BDU:2021-04570
- GHSA-5ww6-px42-wc85
- DSA-4963-1
- openSUSE-SU-2021:1188-1
- openSUSE-SU-2021:2830-1
- openSUSE-SU-2024:11816-1
- openSUSE-SU-2025:15136-1
- RUSTSEC-2021-0097
- SUSE-FU-2022:1419-1
- SUSE-SU-2021:2830-1
- SUSE-SU-2021:2833-1
- SUSE-SU-2022:1396-1
- SUSE-SU-2022:2134-1
- SUSE-SU-2022:3676-1
- SUSE-SU-2022:4428-1
- SUSE-SU-2022:4437-1
- SUSE-SU-2022:4439-1
- SUSE-SU-2024:0191-1
- SUSE-SU-2024:0196-1
- Published
- Aug 24, 2021
- Updated
- Jun 17, 2026
- EPSS
- 87.8% · 100th percentile
- CWE
- CWE-120
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
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
| Vendor | Product | CPE |
|---|---|---|
| openssl | openssl | cpe:2.3:a:openssl:openssl |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
| netapp | active iq unified manager | cpe:2.3:a:netapp:active_iq_unified_manager |
| netapp | clustered data ontap | cpe:2.3:a:netapp:clustered_data_ontap |
| netapp | clustered data ontap antivirus connector | cpe:2.3:a:netapp:clustered_data_ontap_antivirus_connector |
| netapp | e-series santricity os controller | cpe:2.3:a:netapp:e-series_santricity_os_controller |
| netapp | hci management node | cpe:2.3:a:netapp:hci_management_node |
| netapp | manageability software development kit | cpe:2.3:a:netapp:manageability_software_development_kit |
| netapp | oncommand insight | cpe:2.3:a:netapp:oncommand_insight |
| netapp | oncommand workflow automation | cpe:2.3:a:netapp:oncommand_workflow_automation |
| netapp | santricity smi-s provider | cpe:2.3:a:netapp:santricity_smi-s_provider |
| netapp | snapcenter | cpe:2.3:a:netapp:snapcenter |
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.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Alpine:v3.11 | openssl | from 1.1.1 · before 1.1.1l-r0 | 1.1.1l-r0 |
| Alpine:v3.15 | openssl3 | before 1.1.1l-r0 | 1.1.1l-r0 |
| crates.io | openssl-src | from 0.0.0-0 · before 111.16.0 | 111.16.0 |
| crates.io | openssl-src | before 111.16.0 | 111.16.0 |
| Debian:10 | openssl | before 1.1.1d-0+deb10u7 | 1.1.1d-0+deb10u7 |
| Debian:11 | openssl | before 1.1.1k-1+deb11u1 | 1.1.1k-1+deb11u1 |
| Debian:12 | openssl | before 1.1.1l-1 | 1.1.1l-1 |
| openSUSE:Leap 15.2 | openssl-1_1 | before 1.1.1d-lp152.7.21.1 | 1.1.1d-lp152.7.21.1 |
| openSUSE:Leap 15.3 | golang-github-prometheus-promu | before 0.13.0-150000.3.9.1 | 0.13.0-150000.3.9.1 |
| openSUSE:Leap 15.3 | grafana | before 8.3.5-150200.3.21.1 | 8.3.5-150200.3.21.1 |
| openSUSE:Leap 15.3 | openssl-1_1 | before 1.1.1d-11.27.1 | 1.1.1d-11.27.1 |
| openSUSE:Leap 15.4 | wire | before 0.5.0-150000.1.9.3 | 0.5.0-150000.1.9.3 |
| openSUSE:Tumbleweed | grafana | before 8.3.4-1.1 | 8.3.4-1.1 |
| openSUSE:Tumbleweed | grype | before 0.92.1-1.1 | 0.92.1-1.1 |
| SUSE:Enterprise Storage 6 | grafana | before 8.5.13-150100.3.12.1 | 8.5.13-150100.3.12.1 |
| SUSE:HPE Helion OpenStack 8 | golang-github-prometheus-node_exporter | before 1.3.0-1.15.3 | 1.3.0-1.15.3 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP2 | openssl-1_1 | before 1.1.1d-11.27.1 | 1.1.1d-11.27.1 |
| SUSE:Linux Enterprise Module for Package Hub 15 SP4 | grafana | before 8.5.13-150200.3.29.5 | 8.5.13-150200.3.29.5 |
| SUSE:Linux Enterprise Module for Package Hub 15 SP4 | grafana | before 8.5.13-150200.3.29.5 | 8.5.13-150200.3.29.5 |
| SUSE:Manager Client Tools 12 | golang-github-boynux-squid_exporter | before 1.6-1.9.1 | 1.6-1.9.1 |
| SUSE:Manager Client Tools 12 | golang-github-prometheus-alertmanager | before 0.23.0-1.12.3 | 0.23.0-1.12.3 |
| SUSE:Manager Client Tools 12 | golang-github-QubitProducts-exporter_exporter | before 0.4.0-1.6.1 | 0.4.0-1.6.1 |
| SUSE:Manager Client Tools 12 | grafana | before 8.3.5-1.30.3 | 8.3.5-1.30.3 |
| SUSE:Manager Client Tools 12 | grafana | before 8.5.13-1.36.2 | 8.5.13-1.36.2 |
+96
Same product
openssl: all recordsOther 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 remKEV90Now
- 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 denia62This 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 den60This week
- CVE-2022-3786X.509 Email Address Variable Length Buffer Overflow58Plan
- CVE-2022-2068The c_rehash script allows command injection58Plan
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Alpine:openssl | 1.1.1l-r0 · Alpine:v3.11 | Package registry (OSV) |
| Alpine:openssl3 | 1.1.1l-r0 · Alpine:v3.15 | Package registry (OSV) |
| crates.io:openssl-src | 111.16.0 | Package registry (OSV) |
| Debian:openssl | 1.1.1l-1 · Debian:12 | Package registry (OSV) |
| openSUSE:grafana | 8.3.5-150200.3.21.1 · openSUSE:Leap 15.3 | Package registry (OSV) |
| SUSE:grafana | 8.3.5-150000.1.30.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:mgr-cfg | 4.2.8-150000.1.24.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:mgr-osad | 4.2.8-150000.1.36.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:mgr-push | 4.2.5-150000.1.18.2 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:mgr-virtualization | 4.2.4-150000.1.26.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:openssl-1_1 | 1.1.1d-11.27.1 · SUSE:Linux Enterprise Module for Basesystem 15 SP2 | Package registry (OSV) |
| SUSE:prometheus-postgres_exporter | 0.10.0-150000.1.3.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:rhnlib | 4.2.6-150000.3.34.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:spacecmd | 4.2.16-150000.3.77.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:spacewalk-client-tools | 4.2.18-150000.3.59.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:spacewalk-koan | 4.2.6-150000.3.27.1 · SUSE:Manager Client Tools 15 | Package registry (OSV) |
| SUSE:spacewalk-oscap | 4.2.4-150000.3.18.1 · SUSE:Manager Client Tools 15 | Package 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.
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.
Credits
All researchersFinders, 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
Weakness class (CWE)
CWE-120 · Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')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.
The bug in code
The whole CWE-120 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
char buf[256];memcpy(buf, pkt->data, pkt->len);Fixed
char buf[256];if (pkt->len > sizeof(buf)) { return -EINVAL;}memcpy(buf, pkt->data, pkt->len);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Buffer Overflow via Environment VariablesCAPEC-10likelihood: High · High
- Overflow BuffersCAPEC-100likelihood: High · Very High
- Client-side Injection-induced Buffer OverflowCAPEC-14likelihood: Medium · High
- Filter Failure through Buffer OverflowCAPEC-24likelihood: High · High
- MIME ConversionCAPEC-42likelihood: High · High
- Overflow Binary Resource FileCAPEC-44likelihood: High · Very High
- Buffer Overflow via Symbolic LinksCAPEC-45likelihood: High · High
- Overflow Variables and TagsCAPEC-46likelihood: High · High
ATT&CK techniques
—
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 helpChange log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- www.openwall.com/lists/oss-security/2021/08/26/2
- cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf
- git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=59f5e75f3bced8fc0e130d72a3f582cf7b480b46
- lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691e7c59c9e%40%3Cdev.tomcat.apache.org%3E
- lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e5805a713d1%40%3Cdev.tomcat.apache.org%3E
- security.gentoo.org/glsa/202209-02
- security.gentoo.org/glsa/202210-02
- security.netapp.com/advisory/ntap-20210827-0010/
- security.netapp.com/advisory/ntap-20211022-0003/
- security.netapp.com/advisory/ntap-20240621-0006/
- www.debian.org/security/2021/dsa-4963
- www.openssl.org/news/secadv/20210824.txt
- www.oracle.com/security-alerts/cpuapr2022.html
- www.oracle.com/security-alerts/cpujan2022.html
- www.oracle.com/security-alerts/cpuoct2021.html
- www.tenable.com/security/tns-2021-16
- www.tenable.com/security/tns-2022-02
Vendor advisories and official records. Exploit/PoC links are deliberately left out.