🔍 CVE-2021-3712

7.4
CVSS Score
HIGH
2021-08-24
2026-06-17 04:05
✅ 완료

🇰🇷 한글 설명

OpenSSL의 ASN.1 문자열 처리에서 NUL 종료가 보장되지 않아 발생하는 메모리 읽기 버퍼 오버런 취약점입니다. 직접 구성된 ASN1_STRING 구조를 OpenSSL 함수로 처리할 때 비할당 메모리 영역을 읽어 정보 공개 또는 DoS 공격으로 이어질 수 있습니다.

💡 쉬운 설명

OpenSSL에서 문자열을 처리할 때 메모리 경계를 제대로 확인하지 않아 의도하지 않은 데이터를 읽을 수 있는 문제입니다. 응용 프로그램이 비정상적으로 구성된 인증서나 데이터를 처리하면 프라이빗 키 같은 민감한 정보가 노출될 수 있습니다.

🇺🇸 원문 (English)

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

📍 영향받는 시스템

OpenSSL 1.1.1-1.1.1k, OpenSSL 1.0.2-1.0.2y

⚔️ 공격 벡터

악의적 행위자가 응용 프로그램으로 하여금 직접 구성된 ASN1_STRING을 처리하도록 유도 (인증서 직접 구성, X509 함수 호출)

🛡️ 대응 방법

OpenSSL을 1.1.1l 이상 또는 1.0.2za 이상으로 업그레이드

🔧 검증 코드

OpenSSL 버전이 1.1.1l 이상이거나 1.0.2za 이상인지 확인 (1.1.1k 이하 또는 1.0.2y 이하면 취약)

Shell / Script
openssl version

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H

💻 영향받는 소프트웨어

OpenSSL