CVEfocus › CVE database › CVE-2021-3712

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

CVSS 7.4 HighEPSS 48.1% (in the top 1% of all CVEs)Published 2021-08-24Updated 2026-04-16Assigner: openssl

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

CWE-125

What to do

Likely to be exploited: EPSS gives a 48% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.

Fixed builds are available from Alpine, Debian, Red Hat, Rocky Linux, Ubuntu, crates.io: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

38Fixed
5Fix pending
7Will not fix
11Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04edk2Not affected
vulnerable_code_not_present
Ubuntu 26.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 25.10edk2Not affected
vulnerable_code_not_present
Ubuntu 25.10nodejsNot affected
vulnerable_code_not_present
Ubuntu 24.04edk2Not affected
vulnerable_code_not_present
Ubuntu 24.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 22.04edk2Fixed2022.02-3ubuntu0.22.04.4UBUNTU-CVE-2021-3712
Ubuntu 22.04opensslFixed1.1.1l-1ubuntu1UBUNTU-CVE-2021-3712
Ubuntu 20.04edk2Fixed0~20191122.bd85bf54-2ubuntu3.3UBUNTU-CVE-2021-3712
Ubuntu 20.04opensslFixed1.1.1f-1ubuntu2.8UBUNTU-CVE-2021-3712
Ubuntu 18.04edk2Fix pendingUBUNTU-CVE-2021-3712
Ubuntu 18.04opensslFixed1.1.1-1ubuntu2.1~18.04.13UBUNTU-CVE-2021-3712
Ubuntu 18.04openssl1.0Fixed1.0.2n-1ubuntu5.7UBUNTU-CVE-2021-3712
Ubuntu 16.04edk2Fix pendingUBUNTU-CVE-2021-3712
Ubuntu 16.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 16.04opensslFix pending1.0.2g-1ubuntu4.20+esm1 (Ubuntu Pro)UBUNTU-CVE-2021-3712
Ubuntu 14.04edk2Fix pending
Ubuntu 14.04opensslFix pending1.0.1f-1ubuntu2.27+esm4 (Ubuntu Pro)UBUNTU-CVE-2021-3712
Debian 14opensslFixed1.1.1l-1DEBIAN-CVE-2021-3712
Debian 13opensslFixed1.1.1l-1DEBIAN-CVE-2021-3712
Debian 12opensslFixed1.1.1l-1DEBIAN-CVE-2021-3712
Red Hat Enterprise Linux 9opensslNot affected
Red Hat Enterprise Linux 9openssl-develNot affected
Red Hat Enterprise Linux 9openssl-libsNot affected
Red Hat Enterprise Linux 9openssl-perlNot affected
Red Hat Enterprise Linux 8compat-openssl10Will not fix
Will not fix
Red Hat Enterprise Linux 8opensslFixed1:1.1.1k-5.el8_5RHSA-2021:5226
Red Hat Enterprise Linux 8openssl-develFixed1:1.1.1k-5.el8_5RHSA-2021:5226
Red Hat Enterprise Linux 8openssl-libsFixed1:1.1.1k-5.el8_5RHSA-2021:5226
Red Hat Enterprise Linux 8openssl-perlFixed1:1.1.1k-5.el8_5RHSA-2021:5226
Red Hat Enterprise Linux 7opensslFixed1:1.0.2k-23.el7_9RHSA-2022:0064
Red Hat Enterprise Linux 7openssl-develFixed1:1.0.2k-23.el7_9RHSA-2022:0064
Red Hat Enterprise Linux 7openssl-libsFixed1:1.0.2k-23.el7_9RHSA-2022:0064
Red Hat Enterprise Linux 7openssl-perlFixed1:1.0.2k-23.el7_9RHSA-2022:0064
Red Hat Enterprise Linux 7openssl-staticFixed1:1.0.2k-23.el7_9RHSA-2022:0064
Red Hat Enterprise Linux 7openssl098eWill not fix
Out of support scope
Red Hat Enterprise Linux 6opensslWill not fix
Out of support scope
Red Hat Enterprise Linux 6openssl-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6openssl-perlWill not fix
Out of support scope
Red Hat Enterprise Linux 6openssl-staticWill not fix
Out of support scope
Red Hat Enterprise Linux 6openssl098eWill not fix
Out of support scope
Rocky Linux 8opensslFixed1:1.1.1k-5.el8_5RLSA-2021:5226
Alpine Linux 3.24opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.23opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.22opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.21opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.20opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.19opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.18opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.18openssl1.1-compatFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.17opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.17openssl1.1-compatFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.16opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.16openssl3Fixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.15opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.15openssl3Fixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.14opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.13opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.12opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
Alpine Linux 3.11opensslFixed1.1.1l-r0ALPINE-CVE-2021-3712
crates.io libraryopenssl-srcFixed111.16.0GHSA-q9wj-f4qw-6vfj

What the vendor says

As published in the CVE record by openssl, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.