Skip to content
OpenAdvisories
High · 7.4 Public exploit CVE-2021-3712 EUVD-2022-4935GHSA-q9wj-f4qw-6vfjRUSTSEC-2021-0098

Read buffer overruns processing ASN.1 strings

Published Aug 24, 2021 · Updated Apr 16, 2026 · Assigned by openssl

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

Affected products

VendorProductAffectedFixed
OpenSSL OpenSSL 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) —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 openssl 1.1.1l-1 —
Debian 13 openssl 1.1.1l-1 —
Debian 12 openssl 1.1.1l-1 —
Debian 11 openssl 1.1.1k-1+deb11u1 DSA-4963-1
Debian 10 openssl 1.1.1d-0+deb10u7 DSA-4963-1
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Debian 9 openssl 1.1.0l-1~deb9u4 DLA-2766-1
Debian 9 openssl1.0 1.0.2u-1~deb9u6 DLA-2774-1
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS edk2 2024.02-2ubuntu0.6 USN-7894-1
Ubuntu 22.04 LTS edk2 2022.02-3ubuntu0.22.04.4 USN-7894-1
Ubuntu 22.04 LTS openssl 1.1.1l-1ubuntu1 —
Ubuntu 20.04 LTS edk2 0~20191122.bd85bf54-2ubuntu3.3 USN-5088-1
Ubuntu 20.04 LTS openssl 1.1.1f-1ubuntu2.8 USN-5051-1
Ubuntu 18.04 LTS openssl 1.1.1-1ubuntu2.1~18.04.13 USN-5051-1
Ubuntu 18.04 LTS openssl1.0 1.0.2n-1ubuntu5.7 USN-5051-3
Show 9 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro FIPS 20.04 LTS openssl No fix yet —
Ubuntu Pro FIPS 18.04 LTS openssl No fix yet —
Ubuntu Pro FIPS 16.04 LTS openssl No fix yet —
Ubuntu Pro FIPS-updates 20.04 LTS openssl 1.1.1f-1ubuntu2.fips.7.2 —
Ubuntu Pro FIPS-updates 18.04 LTS openssl 1.1.1-1ubuntu2.fips.2.1~18.04.13.2 —
Ubuntu Pro FIPS-updates 16.04 LTS openssl 1.0.2g-1ubuntu4.fips.4.20.1 —
Ubuntu Pro 18.04 LTS edk2 No fix yet —
Ubuntu Pro 16.04 LTS edk2 No fix yet —
Ubuntu Pro 16.04 LTS openssl 1.0.2g-1ubuntu4.20+esm1 USN-5051-2
Ubuntu Pro 14.04 LTS openssl 1.0.1f-1ubuntu2.27+esm4 USN-5051-2
ReleasePackageFixed inAdvisory
RHEL 8 openssl +3 1:1.1.1k-5.el8_5 RHSA-2021:5226
RHEL 7 openssl +4 1:1.0.2k-23.el7_9 RHSA-2022:0064
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Red Hat JBoss Web Server 5 jws5-tomcat +11 9.0.50-3.redhat_00004.1.el7jws RHSA-2021:4861
Red Hat JBoss Web Server 5 jws5-tomcat-native 1.2.30-3.redhat_3.el7jws RHSA-2021:4861
Red Hat JBoss Web Server 5 jws5-tomcat-vault +1 1.1.8-4.Final_redhat_00004.1.el7jws RHSA-2021:4861
Red Hat JBoss Core Services 1 jbcs-httpd24-apr +1 1.6.3-107.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-apr-util +8 1.6.1-84.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-curl +2 7.78.0-2.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-httpd +6 2.4.37-78.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-mod_cluster-native 1.3.16-9.Final_redhat_2.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-mod_http2 1.15.7-21.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-mod_jk +2 1.2.48-20.redhat_1.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-mod_md 1:2.0.8-40.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-mod_security 2.9.2-67.GA.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-mod_ssl +1 1:2.4.37-78.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-nghttp2 +1 1.39.2-39.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-openssl +4 1:1.1.1g-8.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-openssl-chil 1.0.0-7.el8jbcs RHSA-2021:4614
Red Hat JBoss Core Services 1 jbcs-httpd24-openssl-pkcs11 0.4.10-22.el8jbcs RHSA-2021:4614

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 8 openssl 1:1.1.1k-5.el8_5 RLSA-2021:5226
ReleasePackageFixed inAdvisory
SLES 15 SP3 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2994-1, SUSE-SU-2021:2827-1
SLES 15 SP3 openssl-1_1 1.1.1d-11.27.1 SUSE-SU-2021:2966-1, SUSE-SU-2021:2830-1
SLES 15 SP2 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2994-1, SUSE-SU-2021:2827-1
SLES 15 SP2 openssl-1_1 1.1.1d-11.27.1 SUSE-SU-2021:2966-1, SUSE-SU-2021:2830-1
SLES 15 SP1 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2994-1, SUSE-SU-2021:2827-1
SLES 15 SP1 openssl-1_1 1.1.0i-14.18.1 SUSE-SU-2021:2968-1, SUSE-SU-2021:2831-1
SLES 15 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2994-1, SUSE-SU-2021:2827-1
SLES 15 openssl-1_1 1.1.0i-4.60.1 SUSE-SU-2021:2967-1, SUSE-SU-2021:2829-1
SLES 12 SP5 openssl-1_0_0 1.0.2p-3.39.3 SUSE-SU-2021:2995-1, SUSE-SU-2021:2826-1
SLES 12 SP5 openssl-1_1 1.1.1d-2.36.2 SUSE-SU-2021:2996-1, SUSE-SU-2021:2833-1
Show 25 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP4 openssl-1_0_0 1.0.2p-3.39.3 SUSE-SU-2021:2995-1, SUSE-SU-2021:2826-1
SLES 12 SP4 openssl-1_1 1.1.1d-2.36.2 SUSE-SU-2021:2996-1, SUSE-SU-2021:2833-1
SLES 12 SP3 openssl 1.0.2j-60.69.3 SUSE-SU-2021:3144-1, SUSE-SU-2021:2825-1
SLES 12 SP2 openssl 1.0.2j-60.69.3 SUSE-SU-2021:3144-1, SUSE-SU-2021:2825-1
SLES 12 compat-openssl098 0.9.8j-106.27.2 SUSE-SU-2021:3019-1, SUSE-SU-2021:2852-1
SLES 11 SP4 openssl 0.9.8j-0.106.40.1 SUSE-SU-2021:14802-1, SUSE-SU-2021:14791-1
SLES 11 openssl1 1.0.1g-0.58.36.2 SUSE-SU-2021:14801-1, SUSE-SU-2021:14792-1
SLES for SAP 15 SP1 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2994-1, SUSE-SU-2021:2827-1
SLES for SAP 15 SP1 openssl-1_1 1.1.0i-14.18.1 SUSE-SU-2021:2968-1, SUSE-SU-2021:2831-1
SLES for SAP 15 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2994-1, SUSE-SU-2021:2827-1
SLES for SAP 15 openssl-1_1 1.1.0i-4.60.1 SUSE-SU-2021:2967-1, SUSE-SU-2021:2829-1
SLES for SAP 12 SP5 compat-openssl098 0.9.8j-106.27.2 SUSE-SU-2021:3019-1, SUSE-SU-2021:2852-1
SLES for SAP 12 SP5 openssl-1_0_0 1.0.2p-3.39.3 SUSE-SU-2021:2995-1, SUSE-SU-2021:2826-1
SLES for SAP 12 SP5 openssl-1_1 1.1.1d-2.36.2 SUSE-SU-2021:2996-1, SUSE-SU-2021:2833-1
SLES for SAP 12 SP4 compat-openssl098 0.9.8j-106.27.2 SUSE-SU-2021:3019-1, SUSE-SU-2021:2852-1
SLES for SAP 12 SP4 openssl-1_0_0 1.0.2p-3.39.3 SUSE-SU-2021:2995-1, SUSE-SU-2021:2826-1
SLES for SAP 12 SP4 openssl-1_1 1.1.1d-2.36.2 SUSE-SU-2021:2996-1, SUSE-SU-2021:2833-1
SLES for SAP 12 SP3 compat-openssl098 0.9.8j-106.27.2 SUSE-SU-2021:3019-1, SUSE-SU-2021:2852-1
SLES for SAP 12 SP3 openssl 1.0.2j-60.69.3 SUSE-SU-2021:3144-1, SUSE-SU-2021:2825-1
SLE Micro 5.1 openssl-1_1 1.1.1d-11.30.1 SUSE-SU-2021:2966-2
SLE Micro 5.0 openssl-1_1 1.1.1d-11.27.1 SUSE-SU-2021:2966-1, SUSE-SU-2021:2830-1
SLE HPC 15 SP1 openssl-1_1 1.1.0i-14.18.1 SUSE-SU-2021:2968-1, SUSE-SU-2021:2831-1
SLE HPC 15 openssl-1_1 1.1.0i-4.60.1 SUSE-SU-2021:2967-1, SUSE-SU-2021:2829-1
SUSE OpenStack Cloud Crowbar 9 openssl-1_0_0 1.0.2p-3.39.3 SUSE-SU-2021:2995-1, SUSE-SU-2021:2826-1
SUSE OpenStack Cloud Crowbar 9 openssl-1_1 1.1.1d-2.36.2 SUSE-SU-2021:2996-1, SUSE-SU-2021:2833-1
SUSE OpenStack Cloud Crowbar 8 openssl 1.0.2j-60.69.3 SUSE-SU-2021:3144-1, SUSE-SU-2021:2825-1
SUSE OpenStack Cloud 9 openssl-1_0_0 1.0.2p-3.39.3 SUSE-SU-2021:2995-1, SUSE-SU-2021:2826-1
SUSE OpenStack Cloud 9 openssl-1_1 1.1.1d-2.36.2 SUSE-SU-2021:2996-1, SUSE-SU-2021:2833-1
SUSE OpenStack Cloud 8 openssl 1.0.2j-60.69.3 SUSE-SU-2021:3144-1, SUSE-SU-2021:2825-1
SUSE Manager Server 4.0 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2827-1
SUSE Manager Server 4.0 openssl-1_1 1.1.0i-14.18.1 SUSE-SU-2021:2831-1
SUSE Manager Retail Branch Server 4.0 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2827-1
SUSE Manager Retail Branch Server 4.0 openssl-1_1 1.1.0i-14.18.1 SUSE-SU-2021:2831-1
SUSE Manager Proxy 4.0 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2827-1
SUSE Manager Proxy 4.0 openssl-1_1 1.1.0i-14.18.1 SUSE-SU-2021:2831-1
SUSE Linux Enterprise Point of Sale 11 SP3 openssl 0.9.8j-0.106.40.1 SUSE-SU-2021:14802-1, SUSE-SU-2021:14791-1
SUSE HPE Helion OpenStack 8 openssl 1.0.2j-60.69.3 SUSE-SU-2021:3144-1, SUSE-SU-2021:2825-1
SUSE Enterprise Storage 6 openssl-1_0_0 1.0.2p-3.40.2 SUSE-SU-2021:2994-1, SUSE-SU-2021:2827-1
SUSE Enterprise Storage 6 openssl-1_1 1.1.0i-14.18.1 SUSE-SU-2021:2968-1, SUSE-SU-2021:2831-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed nmap 7.93-1.1 openSUSE-SU-2024:12303-1
openSUSE Tumbleweed openssl-1_0_0 1.0.2u-6.2 openSUSE-SU-2024:11126-1
openSUSE Tumbleweed openssl-1_1 1.1.1l-1.2 openSUSE-SU-2024:11127-1
openSUSE Leap 15.3 openssl-1_0_0 1.0.2p-3.40.2 openSUSE-SU-2021:2994-1, openSUSE-SU-2021:2827-1
openSUSE Leap 15.3 openssl-1_1 1.1.1d-11.27.1 openSUSE-SU-2021:2966-1, openSUSE-SU-2021:2830-1
openSUSE Leap 15.2 openssl-1_0_0 1.0.2p-lp152.8.15.1 openSUSE-SU-2021:1261-1, openSUSE-SU-2021:1189-1
openSUSE Leap 15.2 openssl-1_1 1.1.1d-lp152.7.21.1 openSUSE-SU-2021:1248-1, openSUSE-SU-2021:1188-1
ReleasePackageFixed inAdvisory
Alpine v3.24 openssl 1.1.1l-r0 —
Alpine v3.23 openssl 1.1.1l-r0 —
Alpine v3.22 openssl 1.1.1l-r0 —
Alpine v3.21 openssl 1.1.1l-r0 —
Alpine v3.20 openssl 1.1.1l-r0 —
Show 9 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 openssl 1.1.1l-r0 —
Alpine v3.18 openssl +1 1.1.1l-r0 —
Alpine v3.17 openssl +1 1.1.1l-r0 —
Alpine v3.16 openssl +1 1.1.1l-r0 —
Alpine v3.15 openssl +1 1.1.1l-r0 —
Alpine v3.14 openssl 1.1.1l-r0 —
Alpine v3.13 openssl 1.1.1l-r0 —
Alpine v3.12 openssl 1.1.1l-r0 —
Alpine v3.11 openssl 1.1.1l-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2 edk2-ovmf +4 20200801stable-1.amzn2.0.5 ALAS2-2024-2502
Amazon Linux 2 openssl +4 1:1.0.2k-19.amzn2.0.8 ALAS2-2021-1721
Amazon Linux 2 openssl11 +3 1:1.1.1g-12.amzn2.0.4 ALAS2-2021-1714

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 2 (CBL-Mariner) openssl 1.1.1k-11 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 8 openssl +3 1:1.1.1k-5.el8_5 ELSA-2021-5226
Oracle Linux 7 openssl +4 1:1.0.2k-23.el7_9 ELSA-2022-9023, ELSA-2022-0064

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 2 repositories

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
crates.io openssl-src < 111.16.0 111.16.0 GHSA-q9wj-f4qw-6vfj
crates.io openssl-src >= 0.0.0-0, < 111.16.0 111.16.0 RUSTSEC-2021-0098

Advisories 50

References