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.
{
"cna_assigner": "GitHub_M",
"cwe_ids": [
"CWE-400"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/46xxx/CVE-2025-46728.json"
}{
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "0.20.1"
}
],
"source": [
"CPE_RANGE",
"REFERENCES"
],
"cpe": "cpe:2.3:a:cpp-httplib_project:cpp-httplib:*:*:*:*:*:*:*:*"
}
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-46728.json"
[
{
"target": {
"function": "stream_line_reader::getline",
"file": "httplib.h"
},
"deprecated": false,
"source": "https://github.com/yhirose/cpp-httplib/commit/7b752106ac42bd5b907793950d9125a0972c8e8e",
"id": "CVE-2025-46728-18f6418d",
"signature_version": "v1",
"digest": {
"length": 568.0,
"function_hash": "273893763024305777493719782969948749593"
},
"signature_type": "Function"
},
{
"target": {
"file": "test/test.cc"
},
"deprecated": false,
"source": "https://github.com/yhirose/cpp-httplib/commit/7b752106ac42bd5b907793950d9125a0972c8e8e",
"id": "CVE-2025-46728-1b351755",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"257985735793026435818868796645710254975",
"47152089635226046254886122597760746000",
"277935455136829786777737757595575415649",
"240428477853514944703987908155197738368",
"98734447240544736125538254896320203198",
"12401696439684324966363430957733437059",
"232918337349665503594913121985807921549",
"297344248686960807045559079316116779264",
"235855093667763522674929287323664717147",
"52669484370524566126415748220010415188"
]
},
"signature_type": "Line"
},
{
"target": {
"function": "SetUp",
"file": "test/test.cc"
},
"deprecated": false,
"source": "https://github.com/yhirose/cpp-httplib/commit/7b752106ac42bd5b907793950d9125a0972c8e8e",
"id": "CVE-2025-46728-d289d55f",
"signature_version": "v1",
"digest": {
"length": 19168.0,
"function_hash": "88011015293096735173591467930571185687"
},
"signature_type": "Function"
},
{
"target": {
"file": "httplib.h"
},
"deprecated": false,
"source": "https://github.com/yhirose/cpp-httplib/commit/7b752106ac42bd5b907793950d9125a0972c8e8e",
"id": "CVE-2025-46728-f50b3fbc",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"32898783120307941874368505242798629186",
"162037324753814312112070594927690416950",
"287480307527108457454058770006969193908",
"301745308707818391118521842106411970281",
"263861363138065655965234048318932182331",
"218911545314115535196603612996816985361",
"260379456301400884034826106084209849017"
]
},
"signature_type": "Line"
}
]
"2026-08-12T15:16:32Z"