CVE-2021-3712 — Vulnerability in openssl-src — CVE Details
Read buffer overruns processing ASN.1 strings
What Should I Do?
Fix Within 2-4 Weeks
Moderate exploitation risk (48.08% probability in 30 days). Schedule remediation soon.
Does your project use an affected openssl-src version?
Paste your Cargo.lock to check it for CVE-2021-3712 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.1j (Affected 1.1.1-1.1.1k). Fixed in OpenSSL 1.0.2za (Affected 1.0.2-1.0.2y).
Advisory Timeline
- First published May 24, 2022 (1648 days ago).
- Last revised May 5, 2026 — 1442 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p openssl-src --precise 111.16.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| openssl-src crates.io · Affected: All versions | 111.16.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-125Out-of-bounds ReadMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.4 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-3712ADVISORY
- https://www.tenable.com/security/tns-2022-02WEB
- https://www.tenable.com/security/tns-2021-16WEB
- https://www.oracle.com/security-alerts/cpuoct2021.htmlWEB
- https://www.oracle.com/security-alerts/cpujan2022.htmlWEB
- https://www.oracle.com/security-alerts/cpuapr2022.htmlWEB
- https://www.openwall.com/lists/oss-security/2021/08/26/2WEB
- https://www.openssl.org/news/secadv/20210824.txtWEB
- https://www.debian.org/security/2021/dsa-4963WEB
- https://security.netapp.com/advisory/ntap-20240621-0006WEB
- https://security.netapp.com/advisory/ntap-20210827-0010WEB
- https://security.gentoo.org/glsa/202210-02WEB
- https://security.gentoo.org/glsa/202209-02WEB
- https://rustsec.org/advisories/RUSTSEC-2021-0098.htmlWEB
- https://lists.debian.org/debian-lts-announce/2021/09/msg00021.htmlWEB
- https://lists.debian.org/debian-lts-announce/2021/09/msg00014.htmlWEB
- https://lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e5805a713d1@%3Cdev.tomcat.apache.org%3EWEB
- https://lists.apache.org/thread.html/rad5d9f83f0d11fb3f8bb148d179b8a9ad7c6a17f18d70e5805a713d1%40%3Cdev.tomcat.apache.org%3EWEB
- https://lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691e7c59c9e@%3Cdev.tomcat.apache.org%3EWEB
- https://lists.apache.org/thread.html/r18995de860f0e63635f3008fd2a6aca82394249476d21691e7c59c9e%40%3Cdev.tomcat.apache.org%3EWEB
- https://kc.mcafee.com/corporate/index?page=content&id=SB10366WEB
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=ccb0a11145ee72b042d10593a64eaf9e8a55ec12WEB
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=94d23fcff9b2a7a8368dfe52214d5c2569882c11WEB
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=ccb0a11145ee72b042d10593a64eaf9e8a55ec12WEB
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=94d23fcff9b2a7a8368dfe52214d5c2569882c11WEB
- https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdfWEB
- https://cert-portal.siemens.com/productcert/pdf/ssa-244969.pdfWEB
- https://cert-portal.siemens.com/productcert/html/ssa-389290.htmlWEB
- https://cert-portal.siemens.com/productcert/html/ssa-244969.htmlWEB
- https://cert-portal.siemens.com/productcert/html/ssa-028723.htmlWEB
- https://cert-portal.siemens.com/productcert/html/ssa-019200.htmlWEB
Frequently Asked Questions
- What is CVE-2021-3712?
- Read buffer overruns processing ASN.1 strings. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.4/10).
- How do I check if my project is affected by CVE-2021-3712?
- CVE-2021-3712 affects openssl-src. It has a 48.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-3712 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top 5% of EPSS-scored vulnerabilities — 99.1% of tracked vulnerabilities score at or below it, so it is far more likely to be exploited than nearly all other tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2021-3711CRITICAL
SM2 Decryption Buffer Overflow
- CVE-2022-2274CRITICAL
openssl-src heap memory corruption with RSA private key operation
- CVE-2022-3602CRITICAL
X.509 Email Address 4-byte Buffer Overflow
- CVE-2023-0216HIGH
openssl-src subject to Invalid pointer dereference in `d2i_PKCS7` functions
- CVE-2022-3358HIGH
Using a Custom Cipher with `NID_undef` may lead to NULL encryption
- CVE-2022-1473HIGH
Resource leakage when decoding certificates and keys
- CVE-2022-3786HIGH
X.509 Email Address Variable Length Buffer Overflow
- CVE-2021-4044HIGH
Invalid handling of `X509_verify_cert()` internal errors in libssl