🇰🇷 한글 설명
ASN1_mbstring_ncopy() 함수에서 유니코드 출력 버퍼 크기를 계산할 때 부호 있는 정수 오버플로우가 발생하여 힙 버퍼 오버플로우를 유발할 수 있습니다. 이는 시스템 충돌이나 공격자에 의한 코드 실행으로 이어질 수 있는 심각한 보안 취약점입니다.
💡 쉬운 설명
프로그램이 매우 큰 데이터를 처리할 때 메모리 크기를 잘못 계산하여 예상치 못한 메모리 영역을 덮어쓰는 오류입니다. 이로 인해 프로그램이 충돌하거나 해커가 임의의 코드를 실행할 위험이 있습니다.
🇺🇸 원문 (English)
Issue summary: A signed integer overflow when sizing the destination
buffer for Unicode output in ASN1_mbstring_ncopy() can lead to a heap
buffer overflow.
Impact summary: A heap buffer overflow may lead to a crash or possibly
attacker controlled code execution or other undefined behaviour.
In ASN1_mbstring_copy() and ASN1_mbstring_ncopy() the destination
size for Unicode output is computed in a signed int: by left shift
of the input character count for BMPSTRING (UTF-16) and
UNIVERSALSTRING (UTF-32), and by summing per-character byte counts
for UTF8STRING. The calculation overflows when the input reaches
around 2^30 characters. In the worst case (UNIVERSALSTRING at 2^30
characters) the size wraps to zero, OPENSSL_malloc(1) is called, and
the subsequent character copy writes several gigabytes past the
one-byte allocation.
X.509 certificate processing routes through ASN1_STRING_set_by_NID(),
whose DIRSTRING_TYPE mask excludes UNIVERSALSTRING and whose per-NID
size limits cap the input length; no network protocol or
certificate-handling path in OpenSSL exercises the overflow.
Triggering the bug requires an application that calls
ASN1_mbstring_copy() or ASN1_mbstring_ncopy() directly, or registers
a custom string type via ASN1_STRING_TABLE_add(), with
attacker-controlled input on the order of half a gigabyte or more.
For these reasons this issue was assigned Low severity.
The FIPS modules in 4.0, 3.6, 3.5, 3.4 and 3.0 are not affected by
this issue, as the affected code is outside the OpenSSL FIPS module
boundary.
📍 영향받는 시스템
OpenSSL (FIPS 모듈 제외 버전)
⚔️ 공격 벡터
직접 호출 또는 커스텀 문자열 타입 등록을 통해 대용량 공격자 제어 입력 처리
🛡️ 대응 방법
OpenSSL 최신 버전으로 업그레이드하여 패치 적용
🔧 검증 코드
출력된 버전이 패치가 적용된 최신 버전인지 확인