# CVE-2021-3712: Read buffer overruns processing ASN.1 strings

> Attackers can trigger read buffer overruns in OpenSSL when processing non-NUL terminated ASN.1 strings, leading to crashes or information disclosure.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Aug 2021
- **Updated:** 16 Apr 2026
- **Also known as:** ALPINE-CVE-2021-3712, AZL-6780, CLEANSTART-2026-AP04707, CLSA-2021-1639681783, DEBIAN-CVE-2021-3712, DLA-2766-1, DLA-2774-1, GHSA-q9wj-f4qw-6vfj, JLSEC-2026-225, RHSA-2021:5226, RHSA-2022:0064, RLSA-2021:5226, RUSTSEC-2021-0098, SUSE-SU-2021:14791-1, SUSE-SU-2021:14792-1, SUSE-SU-2021:14801-1, SUSE-SU-2021:14802-1, SUSE-SU-2021:2825-1, SUSE-SU-2021:2826-1, SUSE-SU-2021:2827-1, SUSE-SU-2021:2829-1, SUSE-SU-2021:2831-1, SUSE-SU-2021:2852-1, SUSE-SU-2021:2966-1, SUSE-SU-2021:2966-2, SUSE-SU-2021:2967-1, SUSE-SU-2021:2968-1, SUSE-SU-2021:2994-1, SUSE-SU-2021:2995-1, SUSE-SU-2021:2996-1, SUSE-SU-2021:3019-1, SUSE-SU-2021:3144-1, UBUNTU-CVE-2021-3712, USN-5051-2, USN-5051-3, openSUSE-SU-2021:1189-1, openSUSE-SU-2021:1248-1, openSUSE-SU-2021:1261-1, openSUSE-SU-2021:2827-1, openSUSE-SU-2021:2966-1, openSUSE-SU-2021:2994-1, openSUSE-SU-2024:12303-1

## What is CVE-2021-3712?

CVE-2021-3712 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 24 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

ASN.1 strings are represented internally within OpenSSL as an ASN1_STRING structure which contains a buffer holding the string data and a field holding the buffer length. This contrasts with normal C strings which are repesented as a buffer for the string data which is terminated with a NUL (0) byte. Although not a strict requirement, ASN.1 strings that are parsed using OpenSSL's own "d2i" functions (and other similar parsing functions) as well as any string whose value has been set with the ASN1_STRING_set() function will additionally NUL terminate the byte array in the ASN1_STRING structure. However, it is possible for applications to directly construct valid ASN1_STRING structures which do not NUL terminate the byte array by directly setting the "data" and "length" fields in the ASN1_STRING array. This can also happen by using the ASN1_STRING_set0() function. Numerous OpenSSL functions that print ASN.1 data have been found to assume that the ASN1_STRING byte array will be NUL terminated, even though this is not guaranteed for strings that have been directly constructed. Where an application requests an ASN.1 structure to be printed, and where that ASN.1 structure contains ASN1_STRINGs that have been directly constructed by the application without NUL terminating the "data" field, then a read buffer overrun can occur. The same thing can also occur during name constraints processing of certificates (for example if a certificate has been directly constructed by the application instead of loading it via the OpenSSL parsing functions, and the certificate contains non NUL terminated ASN1_STRING structures). It can also occur in the X509_get1_email(), X509_REQ_get1_email() and X509_get1_ocsp() functions. If a malicious actor can cause an application to directly construct an ASN1_STRING and then process it through one of the affected OpenSSL functions then this issue could be hit. This might result in a crash (causing a Denial of Service attack). It could also result in the disclosure of private memory contents (such as private keys, or sensitive plaintext). Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k). Fixed in OpenSSL 1.0.2za (Affected 1.0.2-1.0.2y).

Weakness: CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2021-3712?

3 open source packages ship an affected version, including openssl-src. It affects 32 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openssl-src` | crates.io | All versions | 111.16.0 |
| `openssl-src` | crates.io | All versions | 111.16.0 |
| `openssl-src` | crates.io | From 0.0.0-0 | 111.16.0 |
| `openssl` | Red Hat:enterprise_linux:7::client | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-devel` | Red Hat:enterprise_linux:7::client | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-libs` | Red Hat:enterprise_linux:7::client | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-perl` | Red Hat:enterprise_linux:7::client | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-static` | Red Hat:enterprise_linux:7::client | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-perl` | Red Hat:enterprise_linux:7::computenode | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-static` | Red Hat:enterprise_linux:7::computenode | All versions | 1:1.0.2k-23.el7_9 |
| `openssl` | Red Hat:enterprise_linux:7::server | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-debuginfo` | Red Hat:enterprise_linux:7::server | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-devel` | Red Hat:enterprise_linux:7::server | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-libs` | Red Hat:enterprise_linux:7::server | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-perl` | Red Hat:enterprise_linux:7::server | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-static` | Red Hat:enterprise_linux:7::server | All versions | 1:1.0.2k-23.el7_9 |
| `openssl` | Red Hat:enterprise_linux:7::workstation | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-debuginfo` | Red Hat:enterprise_linux:7::workstation | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-devel` | Red Hat:enterprise_linux:7::workstation | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-libs` | Red Hat:enterprise_linux:7::workstation | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-perl` | Red Hat:enterprise_linux:7::workstation | All versions | 1:1.0.2k-23.el7_9 |
| `openssl-static` | Red Hat:enterprise_linux:7::workstation | All versions | 1:1.0.2k-23.el7_9 |
| `openssl` | Red Hat:enterprise_linux:8::baseos | All versions | 1:1.1.1k-5.el8_5 |
| `openssl-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 1:1.1.1k-5.el8_5 |
| `openssl-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 1:1.1.1k-5.el8_5 |
| `openssl-devel` | Red Hat:enterprise_linux:8::baseos | All versions | 1:1.1.1k-5.el8_5 |
| `openssl-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 1:1.1.1k-5.el8_5 |
| `openssl-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 1:1.1.1k-5.el8_5 |
| `openssl-perl` | Red Hat:enterprise_linux:8::baseos | All versions | 1:1.1.1k-5.el8_5 |
| `openssl` | Rocky Linux:8 | All versions | 1:1.1.1k-5.el8_5 |
| `openssl-1_0_0` | SUSE:Enterprise Storage 6 | All versions | 1.0.2p-3.40.2 |
| `openssl-1_0_0` | SUSE:Enterprise Storage 6 | All versions | 1.0.2p-3.43.1 |
| `openssl-1_1` | SUSE:Enterprise Storage 6 | All versions | 1.1.0i-14.18.1 |
| `openssl-1_1` | SUSE:Enterprise Storage 6 | All versions | 1.1.0i-14.21.2 |
| `openssl` | SUSE:HPE Helion OpenStack 8 | All versions | 1.0.2j-60.69.3 |
| `openssl` | SUSE:HPE Helion OpenStack 8 | All versions | 1.0.2j-60.72.2 |
| `openssl-1_1` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 1.1.0i-14.18.1 |

Products: Debian Debian Linux, Mcafee Epolicy Orchestrator, Netapp Clustered Data Ontap, Netapp Clustered Data Ontap Antivirus Connector, Netapp E-Series Santricity Os Controller, Netapp Hci Management Node, Netapp Manageability Software Development Kit, Netapp Santricity Smi-S Provider, Netapp Solidfire, Netapp Storage Encryption, Openssl Openssl, Oracle Communications Cloud Native Core Console, Oracle Communications Cloud Native Core Security Edge Protection Proxy, Oracle Communications Cloud Native Core Unified Data Repository, Oracle Communications Session Border Controller, Oracle Communications Unified Session Manager, Oracle Enterprise Communications Broker, Oracle Enterprise Session Border Controller, Oracle Essbase, Oracle Health Sciences Inform Publisher and 12 more.

## How do I fix CVE-2021-3712?

Upgrade openssl-src to 111.16.0 or later.

## Is CVE-2021-3712 being exploited?

There is no known exploitation of CVE-2021-3712 in the wild and no public exploit code.

Public exploit code:

- Production Ready Steps for Remediating a openssl CVE(https://nvd.nist.gov/vuln/detail/cve-2021-3712) on EOL CentOS7 box (github_poc): https://github.com/code-with-amitk/CentOS7_CVE-2021-3712_Remediation

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-3712 and fix it if it is affected.

What it is: CVE-2021-3712 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 24 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-3712 in the wild and no public exploit code.

Affected packages and fixed versions:
- openssl-src (crates.io): affected all versions; fixed in 111.16.0
- openssl-src (crates.io): affected all versions; fixed in 111.16.0
- openssl-src (crates.io): affected from 0.0.0-0; fixed in 111.16.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-3712/ (Markdown: https://insights.sbomify.com/CVE-2021-3712/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-3712
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-3712
- OSV: https://osv.dev/vulnerability/CVE-2021-3712

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-3712/
Summaries are generated and may contain mistakes; the official description above is the record.
