CVE-2021-3712Read buffer overruns processing ASN.1 strings
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).
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | edk2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 26.04 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | edk2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | edk2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | edk2 | Fixed | 2022.02-3ubuntu0.22.04.4 | UBUNTU-CVE-2021-3712 |
| Ubuntu 22.04 | openssl | Fixed | 1.1.1l-1ubuntu1 | UBUNTU-CVE-2021-3712 |
| Ubuntu 20.04 | edk2 | Fixed | 0~20191122.bd85bf54-2ubuntu3.3 | UBUNTU-CVE-2021-3712 |
| Ubuntu 20.04 | openssl | Fixed | 1.1.1f-1ubuntu2.8 | UBUNTU-CVE-2021-3712 |
| Ubuntu 18.04 | edk2 | Fix pending | UBUNTU-CVE-2021-3712 | |
| Ubuntu 18.04 | openssl | Fixed | 1.1.1-1ubuntu2.1~18.04.13 | UBUNTU-CVE-2021-3712 |
| Ubuntu 18.04 | openssl1.0 | Fixed | 1.0.2n-1ubuntu5.7 | UBUNTU-CVE-2021-3712 |
| Ubuntu 16.04 | edk2 | Fix pending | UBUNTU-CVE-2021-3712 | |
| Ubuntu 16.04 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | openssl | Fix pending | 1.0.2g-1ubuntu4.20+esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-3712 |
| Ubuntu 14.04 | edk2 | Fix pending | ||
| Ubuntu 14.04 | openssl | Fix pending | 1.0.1f-1ubuntu2.27+esm4 (Ubuntu Pro) | UBUNTU-CVE-2021-3712 |
| Debian 14 | openssl | Fixed | 1.1.1l-1 | DEBIAN-CVE-2021-3712 |
| Debian 13 | openssl | Fixed | 1.1.1l-1 | DEBIAN-CVE-2021-3712 |
| Debian 12 | openssl | Fixed | 1.1.1l-1 | DEBIAN-CVE-2021-3712 |
| Red Hat Enterprise Linux 9 | openssl | Not affected | ||
| Red Hat Enterprise Linux 9 | openssl-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | openssl-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | openssl-perl | Not affected | ||
| Red Hat Enterprise Linux 8 | compat-openssl10 | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | openssl | Fixed | 1:1.1.1k-5.el8_5 | RHSA-2021:5226 |
| Red Hat Enterprise Linux 8 | openssl-devel | Fixed | 1:1.1.1k-5.el8_5 | RHSA-2021:5226 |
| Red Hat Enterprise Linux 8 | openssl-libs | Fixed | 1:1.1.1k-5.el8_5 | RHSA-2021:5226 |
| Red Hat Enterprise Linux 8 | openssl-perl | Fixed | 1:1.1.1k-5.el8_5 | RHSA-2021:5226 |
| Red Hat Enterprise Linux 7 | openssl | Fixed | 1:1.0.2k-23.el7_9 | RHSA-2022:0064 |
| Red Hat Enterprise Linux 7 | openssl-devel | Fixed | 1:1.0.2k-23.el7_9 | RHSA-2022:0064 |
| Red Hat Enterprise Linux 7 | openssl-libs | Fixed | 1:1.0.2k-23.el7_9 | RHSA-2022:0064 |
| Red Hat Enterprise Linux 7 | openssl-perl | Fixed | 1:1.0.2k-23.el7_9 | RHSA-2022:0064 |
| Red Hat Enterprise Linux 7 | openssl-static | Fixed | 1:1.0.2k-23.el7_9 | RHSA-2022:0064 |
| Red Hat Enterprise Linux 7 | openssl098e | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | openssl | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | openssl-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | openssl-perl | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | openssl-static | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | openssl098e | Will not fix Out of support scope | ||
| Rocky Linux 8 | openssl | Fixed | 1:1.1.1k-5.el8_5 | RLSA-2021:5226 |
| Alpine Linux 3.24 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.23 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.22 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.21 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.20 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.19 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.18 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.18 | openssl1.1-compat | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.17 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.17 | openssl1.1-compat | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.16 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.16 | openssl3 | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.15 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.15 | openssl3 | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.14 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.13 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.12 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| Alpine Linux 3.11 | openssl | Fixed | 1.1.1l-r0 | ALPINE-CVE-2021-3712 |
| crates.io library | openssl-src | Fixed | 111.16.0 | GHSA-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.
- OpenSSL: affected: 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)
Vendor advisories:
- https://www.debian.org/security/2021/dsa-4963 (vendor-advisory)
- https://security.gentoo.org/glsa/202209-02 (vendor-advisory)
- https://security.gentoo.org/glsa/202210-02 (vendor-advisory)
References
- https://www.openssl.org/news/secadv/20210824.txt
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=94d23fcff9b2a7a8368dfe52214d5c2569882c11
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=ccb0a11145ee72b042d10593a64eaf9e8a55ec12
- https://www.debian.org/security/2021/dsa-4963
- https://lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691e7c59c9e%40%3Cdev.tomcat.apache.org%3E
- http://www.openwall.com/lists/oss-security/2021/08/26/2
- https://lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e5805a713d1%40%3Cdev.tomcat.apache.org%3E
- https://security.netapp.com/advisory/ntap-20210827-0010/
- https://lists.debian.org/debian-lts-announce/2021/09/msg00014.html
- https://lists.debian.org/debian-lts-announce/2021/09/msg00021.html
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://www.tenable.com/security/tns-2021-16
- https://kc.mcafee.com/corporate/index?page=content&id=SB10366
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.tenable.com/security/tns-2022-02
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.