🇰🇷 한글 설명
TLS 1.3 연결에서 인증서 압축을 사용할 때, 공격자가 큰 버퍼를 할당하게 하여 서비스 장애 또는 자원 고갈을 유발할 수 있는 취약점
💡 쉬운 설명
OpenSSL에서 TLS 1.3 인증서 압축을 사용할 때, 공격자가 큰 버퍼를 할당하게 하여 서비스 장애 또는 자원 고갈을 유발할 수 있습니다. 이는 인증서 길이 검사를 제대로 하지 않아 발생합니다.
🇺🇸 원문 (English)
Issue summary: A TLS 1.3 connection using certificate compression can be
forced to allocate a large buffer before decompression without checking
against the configured certificate size limit.
Impact summary: An attacker can cause per-connection memory allocations of
up to approximately 22 MiB and extra CPU work, potentially leading to
service degradation or resource exhaustion (Denial of Service).
In affected configurations, the peer-supplied uncompressed certificate
length from a CompressedCertificate message is used to grow a heap buffer
prior to decompression. This length is not bounded by the max_cert_list
setting, which otherwise constrains certificate message sizes. An attacker
can exploit this to cause large per-connection allocations followed by
handshake failure. No memory corruption or information disclosure occurs.
This issue only affects builds where TLS 1.3 certificate compression is
compiled in (i.e., not OPENSSL_NO_COMP_ALG) and at least one compression
algorithm (brotli, zlib, or zstd) is available, and where the compression
extension is negotiated. Both clients receiving a server CompressedCertificate
and servers in mutual TLS scenarios receiving a client CompressedCertificate
are affected. Servers that do not request client certificates are not
vulnerable to client-initiated attacks.
Users can mitigate this issue by setting SSL_OP_NO_RX_CERTIFICATE_COMPRESSION
to disable receiving compressed certificates.
The FIPS modules in 3.6, 3.5, 3.4 and 3.3 are not affected by this issue,
as the TLS implementation is outside the OpenSSL FIPS module boundary.
OpenSSL 3.6, 3.5, 3.4 and 3.3 are vulnerable to this issue.
OpenSSL 3.0, 1.1.1 and 1.0.2 are not affected by this issue.
📍 영향받는 시스템
OpenSSL 3.6, 3.5, 3.4, 3.3
⚔️ 공격 벡터
공격자가 CompressedCertificate 메시지를 보내어 큰 버퍼를 할당하게 함
🛡️ 대응 방법
SSL_OP_NO_RX_CERTIFICATE_COMPRESSION 설정을 사용하여 압축된 인증서 수신을 비활성화함
🔧 검증 코드
이 코드는 로컬 시스템의 OpenSSL 버전을 확인하여 취약점 여부를 판단합니다. 코드를 실행하기 전에, 로컬 시스템에 OpenSSL이 설치되어 있어야 하며, Python 3.x 버전이 설치되어 있어야 합니다. 코드를 실행하면, OpenSSL 버전을 확인하고 취약점 여부를 출력합니다.
import subprocess
result = subprocess.run(['openssl', 'version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
version = result.stdout.decode('utf-8').split(' ')[1]
if version in ['OpenSSL 3.6', 'OpenSSL 3.5', 'OpenSSL 3.4', 'OpenSSL 3.3']:
print({"result": "취약", "reason": "OpenSSL 버전이 취약한 버전입니다."})
else:
print({"result": "양호", "reason": "OpenSSL 버전이 취약하지 않은 버전입니다."})