🔍 CVE-2025-64076

7.5
CVSS Score
HIGH
2025-11-18
2026-11-05 14:10
✅ 완료

🇰🇷 한글 설명

cbor2 5.7.0 이하 버전의 C 확장 디코더(decode_definite_long_string 함수)에는 여러 취약점이 존재합니다. 청크 처리 루프의 상태 초기화 누락으로 인한 정수 언더플로우로 범위를 벗어난 읽기가 발생하며, 객체 참조 해제 누락으로 메모리 누수가 발생합니다. 이를 통해 원격에서 인증 없이 서비스 거부(DoS)를 유발할 수 있습니다.

💡 쉬운 설명

외부에서 조작된 CBOR 데이터를 보내면 cbor2 라이브러리가 잘못 동작해 프로그램이 비정상 종료되거나 메모리가 고갈될 수 있습니다. 이 라이브러리를 사용하는 웹 API나 IoT 수집기 등이 서비스 중단 위험에 노출됩니다.

🇺🇸 원문 (English)

Multiple vulnerabilities exist in cbor2 through version 5.7.0 in the decode_definite_long_string() function of the C extension decoder (source/decoder.c): (1) Integer Underflow Leading to Out-of-Bounds Read (CWE-191, CWE-125): An incorrect variable reference and missing state reset in the chunk processing loop causes buffer_length to not be reset to zero after UTF-8 character consumption. This results in subsequent chunk_length calculations producing negative values (e.g., chunk_length = 65536 - buffer_length), which are passed as signed integers to the read() method, potentially triggering unlimited read operations and resource exhaustion. (2) Memory Leak via Missing Reference Count Release (CWE-401): The main processing loop fails to release Python object references (Py_DECREF) for chunk objects allocated in each iteration. For CBOR strings longer than 65536 bytes, this causes cumulative memory leaks proportional to the payload size, enabling memory exhaustion attacks through repeated processing of large CBOR payloads. Both vulnerabilities can be exploited remotely without authentication by sending specially-crafted CBOR data containing definite-length text strings with multi-byte UTF-8 characters positioned at 65536-byte chunk boundaries. Successful exploitation results in denial of service through process crashes (CBORDecodeEOF exceptions) or memory exhaustion. The vulnerabilities affect all applications using cbor2's C extension to process untrusted CBOR data, including web APIs, IoT data collectors, and message queue processors. Fixed in commit 851473490281f82d82560b2368284ef33cf6e8f9 pushed with released version 5.7.1.

📍 영향받는 시스템

cbor2 5.7.0 이하 버전을 C 확장과 함께 사용하는 모든 애플리케이션 (5.7.1 미만)

⚔️ 공격 벡터

인증 없이 65536바이트 청크 경계에 멀티바이트 UTF-8 문자가 위치하도록 조작된 CBOR 데이터를 원격으로 전송

🛡️ 대응 방법

cbor2를 5.7.1 이상 버전으로 업그레이드 (pip install --upgrade cbor2)

🔧 검증 코드

출력된 버전이 5.7.1 미만이면 취약하므로 업그레이드가 필요하고, 5.7.1 이상이면 패치가 적용된 상태입니다.

Shell / Script
pip show cbor2 2>/dev/null | grep -i '^version'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Python