🇰🇷 한글 설명
cpp-httplib 라이브러리의 Client::open_stream 함수에서 사용자 제어 경로가 적절한 인코딩 없이 처리되는 취약점이 발견되었습니다. 공격자가 경로에 줄바꿈 문자(CRLF)를 삽입하여 HTTP 요청 라인을 분할하고 임의의 요청 메타데이터를 주입할 수 있습니다. 이 문제는 0.51.0 버전에서 수정되었습니다.
💡 쉬운 설명
웹 통신을 도와주는 도구에서 주소창에 특수 문자를 넣어 보내면, 원래 보내려던 명령 외에 공격자가 원하는 가짜 명령을 몰래 끼워 넣을 수 있는 문제입니다. 이를 통해 서버가 잘못된 정보를 읽게 만들 수 있습니다.
🇺🇸 원문 (English)
cpp-httplib is a C++ header-only HTTP/HTTPS library. From 0.29.0 until 0.51.0, Client::open_stream in httplib.h accepts a caller-controlled path that reaches detail::write_request_line() without the detail::encode_path() protection used by the ordinary buffered request path. Raw carriage-return and line-feed bytes in the path can therefore split the outbound HTTP/1.1 request line and inject attacker-shaped request metadata. Exploitation requires an embedding application to pass remote user input into the open_stream path and a backend or intermediary that interprets the injected bytes; the established impact is modification of backend-visible request data, not direct confidentiality or availability impact. This issue is fixed in version 0.51.0.
📍 영향받는 시스템
cpp-httplib versions 0.29.0 to 0.51.0
⚔️ 공격 벡터
사용자 입력값이 포함된 경로에 CRLF(
) 문자를 삽입하여 HTTP 요청 라인을 조작하는 HTTP Request Splitting 공격
🛡️ 대응 방법
cpp-httplib 라이브러리를 0.51.0 이상의 최신 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 0.51.0 미만인 경우 해당 취약점에 노출된 상태입니다.
grep -r "httplib.h" . | grep -oE "0\[0-9]+\.[0-9]+\.[0-9]+"