🇰🇷 한글 설명
cpp-httplib 0.20.1 미만 버전에서 Transfer-Encoding: chunked 방식이나 Content-Length 헤더가 없는 요청에 대해 설정된 크기 제한을 강제하지 않는 취약점이 발견되었습니다. 공격자가 종료되는 제로 길이 청크를 포함하지 않은 요청을 보내면 서버의 메모리가 무제한으로 할당되어 시스템 자원 고갈 및 서비스 중단(DoS)을 유발할 수 있습니다.
💡 쉬운 설명
해커가 특수한 방식으로 데이터를 계속 보내면 서버의 메모리가 가득 차서 컴퓨터가 멈추거나 꺼질 수 있는 문제입니다. 이를 막기 위해 라이브러리를 업데이트하거나 앞단에 방어용 서버를 두어야 합니다.
🇺🇸 원문 (English)
cpp-httplib is a C++ header-only HTTP/HTTPS server and client library. Prior to version 0.20.1, the library fails to enforce configured size limits on incoming request bodies when `Transfer-Encoding: chunked` is used or when no `Content-Length` header is provided. A remote attacker can send a chunked request without the terminating zero-length chunk, causing uncontrolled memory allocation on the server. This leads to potential exhaustion of system memory and results in a server crash or unresponsiveness. Version 0.20.1 fixes the issue by enforcing limits during parsing. If the limit is exceeded at any point during reading, the connection is terminated immediately. A short-term workaround through a Reverse Proxy is available. If updating the library immediately is not feasible, deploy a reverse proxy (e.g., Nginx, HAProxy) in front of the `cpp-httplib` application. Configure the proxy to enforce maximum request body size limits, thereby stopping excessively large requests before they reach the vulnerable library code.
📍 영향받는 시스템
cpp-httplib version 0.20.1 미만
⚔️ 공격 벡터
종료 청크가 없는 chunked 요청을 전송하여 서버의 메모리 할당을 유도하는 원격 공격
🛡️ 대응 방법
cpp-httplib를 0.20.1 버전 이상으로 업데이트하거나, Nginx/HAProxy와 같은 리버스 프록시를 사용하여 요청 본문 크기 제한을 설정하십시오.
🔧 검증 코드
프로젝트 내 소스 코드나 설정 파일에서 cpp-httplib 버전을 확인하여 0.20.1 미만인지 확인합니다.
grep -r "cpp-httplib" . | grep -E "version|0\.[0-1][0-9]\.\d+"