🔍 CVE-2021-3711

9.8
CVSS Score
CRITICAL
2021-08-24
2026-10-08 21:17
✅ 완료

🇰🇷 한글 설명

OpenSSL의 SM2 복호화 구현 과정에서 필요한 버퍼 크기를 잘못 계산하는 버그가 발견되었습니다. 이로 인해 복호화 시 할당된 버퍼보다 더 많은 데이터가 쓰여지는 힙 기반 버퍼 오버플로우가 발생할 수 있습니다. 공격자는 이를 통해 애플리케이션의 동작을 변경하거나 시스템을 중단시킬 수 있습니다.

💡 쉬운 설명

암호화된 데이터를 푸는 과정에서 필요한 메모리 공간을 실제보다 작게 계산하는 오류가 있습니다. 이 오류를 이용하면 준비된 공간보다 더 많은 데이터를 강제로 밀어 넣어 프로그램에 오류를 일으키거나 해킹할 수 있습니다.

🇺🇸 원문 (English)

In order to decrypt SM2 encrypted data an application is expected to call the API function EVP_PKEY_decrypt(). Typically an application will call this function twice. The first time, on entry, the "out" parameter can be NULL and, on exit, the "outlen" parameter is populated with the buffer size required to hold the decrypted plaintext. The application can then allocate a sufficiently sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL value for the "out" parameter. A bug in the implementation of the SM2 decryption code means that the calculation of the buffer size required to hold the plaintext returned by the first call to EVP_PKEY_decrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is called by the application a second time with a buffer that is too small. A malicious attacker who is able present SM2 content for decryption to an application could cause attacker chosen data to overflow the buffer by up to a maximum of 62 bytes altering the contents of other data held after the buffer, possibly changing application behaviour or causing the application to crash. The location of the buffer is application dependent but is typically heap allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k).

📍 영향받는 시스템

OpenSSL 1.1.1 ~ 1.1.1k 버전

⚔️ 공격 벡터

조작된 SM2 암호화 데이터를 복호화하도록 유도하여 힙 메모리 버퍼 오버플로우 유발

🛡️ 대응 방법

OpenSSL을 1.1.1l 이상의 버전으로 업데이트

🔧 검증 코드

출력된 버전이 1.1.1l 미만(예: 1.1.1k 이하)인지 확인

Shell / Script
openssl version

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

OpenSSL