CVE Vulnerabilities

CVE-2021-3712

Out-of-bounds Read

Published: Aug 24, 2021 | Modified: Jun 21, 2024
CVSS 3.x
7.4
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H
CVSS 2.x
5.8 MEDIUM
AV:N/AC:M/Au:N/C:P/I:N/A:P
RedHat/V2
RedHat/V3
7.4 MODERATE
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H
Ubuntu
MEDIUM

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 OpenSSLs 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

The product reads data past the end, or before the beginning, of the intended buffer.

Affected Software

Name Vendor Start Version End Version
Openssl Openssl 1.0.2 (including) 1.0.2za (excluding)
Openssl Openssl 1.1.1 (including) 1.1.1l (excluding)
Edk2 Ubuntu bionic *
Edk2 Ubuntu focal *
Edk2 Ubuntu hirsute *
Edk2 Ubuntu impish *
Edk2 Ubuntu trusty *
Edk2 Ubuntu xenial *
Nodejs Ubuntu trusty *
Openssl Ubuntu bionic *
Openssl Ubuntu devel *
Openssl Ubuntu esm-infra/xenial *
Openssl Ubuntu fips-preview/jammy *
Openssl Ubuntu fips-updates/bionic *
Openssl Ubuntu fips-updates/focal *
Openssl Ubuntu fips-updates/jammy *
Openssl Ubuntu fips-updates/xenial *
Openssl Ubuntu fips/bionic *
Openssl Ubuntu fips/focal *
Openssl Ubuntu fips/xenial *
Openssl Ubuntu focal *
Openssl Ubuntu hirsute *
Openssl Ubuntu impish *
Openssl Ubuntu jammy *
Openssl Ubuntu kinetic *
Openssl Ubuntu lunar *
Openssl Ubuntu mantic *
Openssl Ubuntu noble *
Openssl Ubuntu oracular *
Openssl Ubuntu trusty *
Openssl Ubuntu trusty/esm *
Openssl Ubuntu xenial *
Openssl1.0 Ubuntu bionic *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-apr-0:1.6.3-107.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-apr-util-0:1.6.1-84.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-curl-0:7.78.0-2.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-httpd-0:2.4.37-78.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-mod_cluster-native-0:1.3.16-9.Final_redhat_2.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-mod_http2-0:1.15.7-21.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-mod_jk-0:1.2.48-20.redhat_1.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-mod_md-1:2.0.8-40.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-mod_security-0:2.9.2-67.GA.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-nghttp2-0:1.39.2-39.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-openssl-1:1.1.1g-8.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-openssl-chil-0:1.0.0-7.el8jbcs *
JBoss Core Services for RHEL 8 RedHat jbcs-httpd24-openssl-pkcs11-0:0.4.10-22.el8jbcs *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-apr-0:1.6.3-107.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-apr-util-0:1.6.1-84.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-curl-0:7.78.0-2.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-httpd-0:2.4.37-78.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-mod_cluster-native-0:1.3.16-9.Final_redhat_2.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-mod_http2-0:1.15.7-21.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-mod_jk-0:1.2.48-20.redhat_1.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-mod_md-1:2.0.8-40.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-mod_security-0:2.9.2-67.GA.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-nghttp2-0:1.39.2-39.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-openssl-1:1.1.1g-8.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-openssl-chil-0:1.0.0-7.jbcs.el7 *
JBoss Core Services on RHEL 7 RedHat jbcs-httpd24-openssl-pkcs11-0:0.4.10-22.jbcs.el7 *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat acm-grafana-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat acm-must-gather-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat acm-operator-bundle-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat application-ui-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat assisted-image-service-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cert-policy-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cluster-backup-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat clusterclaims-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cluster-curator-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat clusterlifecycle-state-metrics-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat cluster-proxy-addon-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat config-policy-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat console-api-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat console-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat discovery-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat endpoint-monitoring-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-propagator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-spec-sync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-status-sync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat governance-policy-template-sync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat grafana-dashboard-loader-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat grc-ui-api-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat grc-ui-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat iam-policy-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat insights-client-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat insights-metrics-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat klusterlet-addon-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat klusterlet-addon-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat klusterlet-operator-bundle-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat kube-rbac-proxy-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat kube-state-metrics-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat managedcluster-import-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat management-ingress-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat memcached-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat memcached-exporter-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat metrics-collector-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicloud-integrations-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicloud-manager-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multiclusterhub-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multiclusterhub-repo-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-observability-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-application-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-channel-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-deployable-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-placementrule-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-subscription-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat multicluster-operators-subscription-release-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat node-exporter-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat observatorium-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat observatorium-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat openshift-hive-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat placement-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat prometheus-alertmanager-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat prometheus-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat provider-credential-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rbac-query-proxy-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat redisgraph-tls-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat registration-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat registration-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-agent-service-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-assisted-installer-agent-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-assisted-installer-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat rhacm-assisted-installer-reporter-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-aggregator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-api-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-collector-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-operator-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat search-ui-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat submariner-addon-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat thanos-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat thanos-receive-controller-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-mover-rclone-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-mover-restic-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat volsync-mover-rsync-container *
Red Hat Advanced Cluster Management for Kubernetes 2 RedHat work-container *
Red Hat Enterprise Linux 7 RedHat openssl-1:1.0.2k-23.el7_9 *
Red Hat Enterprise Linux 8 RedHat openssl-1:1.1.1k-5.el8_5 *
Red Hat JBoss Core Services 1 RedHat openssl *
Red Hat JBoss Web Server 5 RedHat *
Red Hat JBoss Web Server 5.6 on RHEL 7 RedHat jws5-tomcat-0:9.0.50-3.redhat_00004.1.el7jws *
Red Hat JBoss Web Server 5.6 on RHEL 7 RedHat jws5-tomcat-native-0:1.2.30-3.redhat_3.el7jws *
Red Hat JBoss Web Server 5.6 on RHEL 7 RedHat jws5-tomcat-vault-0:1.1.8-4.Final_redhat_00004.1.el7jws *
Red Hat JBoss Web Server 5.6 on RHEL 8 RedHat jws5-tomcat-0:9.0.50-3.redhat_00004.1.el8jws *
Red Hat JBoss Web Server 5.6 on RHEL 8 RedHat jws5-tomcat-native-0:1.2.30-3.redhat_3.el8jws *
Red Hat JBoss Web Server 5.6 on RHEL 8 RedHat jws5-tomcat-vault-0:1.1.8-4.Final_redhat_00004.1.el8jws *

Potential Mitigations

  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • To reduce the likelihood of introducing an out-of-bounds read, ensure that you validate and ensure correct calculations for any length argument, buffer size calculation, or offset. Be especially careful of relying on a sentinel (i.e. special character such as NUL) in untrusted inputs.

References