🔍 CVE-2026-31870

7.5
CVSS Score
HIGH
2026-03-11
2026-06-17 10:34
✅ 완료

🇰🇷 한글 설명

cpp-httplib 0.37.1 미만 버전에서 스트리밍 API 사용 시 서버로부터 받은 Content-Length 헤더 값을 검증 없이 std::stoull()로 처리하여 발생하는 취약점입니다. 비숫자형 문자열이나 범위를 초과하는 값이 전달될 경우 예외 처리가 되지 않아 std::terminate()가 호출되며 프로세스가 즉시 종료됩니다. 공격자는 악의적인 HTTP 응답을 통해 클라이언트 애플리케이션을 강제로 종료(DoS)시킬 수 있습니다.

💡 쉬운 설명

웹 서버가 보내는 특정 숫자 정보가 잘못되었을 때, 이를 처리하는 프로그램이 오류를 견디지 못하고 갑자기 꺼져버리는 문제입니다. 해커가 조작된 정보를 보내기만 하면 사용자의 프로그램이 즉시 멈추게 만들 수 있습니다.

🇺🇸 원문 (English)

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.37.1, when a cpp-httplib client uses the streaming API (httplib::stream::Get, httplib::stream::Post, etc.), the library calls std::stoull() directly on the Content-Length header value received from the server with no input validation and no exception handling. std::stoull throws std::invalid_argument for non-numeric strings and std::out_of_range for values exceeding ULLONG_MAX. Since nothing catches these exceptions, the C++ runtime calls std::terminate(), which kills the process with SIGABRT. Any server the client connects to — including servers reached via HTTP redirects, third-party APIs, or man-in-the-middle positions can crash the client application with a single HTTP response. No authentication is required. No interaction from the end user is required. The crash is deterministic and immediate. This vulnerability is fixed in 0.37.1.

📍 영향받는 시스템

cpp-httplib versions prior to 0.37.1

⚔️ 공격 벡터

악의적인 서버 또는 중간자(MITM) 공격자가 조작된 Content-Length 헤더를 포함한 HTTP 응답을 전송

🛡️ 대응 방법

cpp-httplib 라이브러리를 0.37.1 버전 이상으로 업데이트

🔧 검증 코드

출력된 결과에서 사용 중인 cpp-httplib의 버전이 0.37.1 미만인지 확인하십시오.

Shell / Script
grep -r "cpp-httplib" . | grep -E 'version|0\.[0-3][0-6]\.'

📊 CVSS Vector String

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