🔍 CVE-2025-66570

10.0
CVSS Score
CRITICAL
2025-12-05
2026-06-17 09:57
✅ 완료

🇰🇷 한글 설명

cpp-httplib 0.27.0 미만 버전에서 공격자가 제어하는 HTTP 헤더가 서버의 메타데이터, 로깅 및 인증 결정에 영향을 미칠 수 있는 취약점이 발견되었습니다. 공격자가 REMOTE_ADDR, REMOTE_PORT 등의 헤더를 주입하면 서버가 내부적으로 생성하는 메타데이터보다 우선순위를 갖게 되어 IP 스푸핑, 로그 오염 및 인증 우회가 가능합니다.

💡 쉬운 설명

해커가 가짜 정보를 담은 특수한 요청을 보내 서버가 실제 접속자의 정보 대신 해커가 조작한 정보를 믿게 만드는 취약점입니다. 이를 통해 해커는 자신의 IP를 숨기거나 서버의 보안 기록을 조작할 수 있습니다.

🇺🇸 원문 (English)

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.27.0, a vulnerability allows attacker-controlled HTTP headers to influence server-visible metadata, logging, and authorization decisions. An attacker can inject headers named REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, LOCAL_PORT that are parsed into the request header multimap via read_headers() in httplib.h (headers.emplace), then the server later appends its own internal metadata using the same header names in Server::process_request without erasing duplicates. Because Request::get_header_value returns the first entry for a header key (id == 0) and the client-supplied headers are parsed before server-inserted headers, downstream code that uses these header names may inadvertently use attacker-controlled values. Affected files/locations: cpp-httplib/httplib.h (read_headers, Server::process_request, Request::get_header_value, get_header_value_u64) and cpp-httplib/docker/main.cc (get_client_ip, nginx_access_logger, nginx_error_logger). Attack surface: attacker-controlled HTTP headers in incoming requests flow into the Request.headers multimap and into logging code that reads forwarded headers, enabling IP spoofing, log poisoning, and authorization bypass via header shadowing. This vulnerability is fixed in 0.27.0.

📍 영향받는 시스템

cpp-httplib 0.27.0 미만 버전

⚔️ 공격 벡터

조작된 HTTP 헤더(REMOTE_ADDR, REMOTE_PORT 등)를 포함한 요청을 전송하여 헤더 섀도잉(Header Shadowing) 유도

🛡️ 대응 방법

cpp-httplib를 0.27.0 이상의 버전으로 업데이트

🔧 검증 코드

명령어 결과에 0.27.0이 아닌 다른 버전 번호가 출력되면 취약한 버전이 설치된 것입니다.

Shell / Script
grep -r "#define CPPHTTPLIB_VERSION" . | grep -v '0.27.0'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Nginx