{"id":"CVE-2026-45352","aliases":["CVE-2026-45352"],"related":[],"kind":"vulnerability","state":"published","title":"cpp-httplib DoS: Negative chunk-size in chunked Transfer-Encoding","summary":"cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.43.4, negative chunk-size in chunked Transfer-Encoding causes unbounded memory allocation and process crash. The ChunkedDecoder::read_payload function in cpp-httplib (httplib.h) parses the chunk-size field of HTTP chunked transfer encoding using std::strtoul(). Per the C standard (§7.22.1.4), strtoul silently accepts a leading minus sign, performing unsigned wrap-around: strtoul(\"-2\", …, 16) returns ULONG_MAX − 1 (0xFFFFFFFFFFFFFFFE). The library's only guard (line 12833) rejects ULONG_MAX (the result of \"-1\"), but any other negative value such as \"-2\" passes validation. The resulting near-maximum value is stored in chunk_remaining and controls how many bytes the server's read loop consumes from the network. This vulnerability is fixed in 0.43.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.43.4, negative chunk-size in chunked Transfer-Encoding causes unbounded memory allocation and process crash. The ChunkedDecoder::read_payload function in cpp-httplib (httplib.h) parses the chunk-size field of HTTP chunked transfer encoding using std::strtoul(). Per the C standard (§7.22.1.4), strtoul silently accepts a leading minus sign, performing unsigned wrap-around: strtoul(\"-2\", …, 16) returns ULONG_MAX − 1 (0xFFFFFFFFFFFFFFFE). The library's only guard (line 12833) rejects ULONG_MAX (the result of \"-1\"), but any other negative value such as \"-2\" passes validation. The resulting near-maximum value is stored in chunk_remaining and controls how many bytes the server's read loop consumes from the network. This vulnerability is fixed in 0.43.4.","source":"cvelist"},{"lang":"es","text":"cpp-httplib es una biblioteca HTTP/HTTPS multiplataforma de C++11 de un solo archivo de solo encabezado. Antes de la 0.43.4, un tamaño de fragmento negativo en la codificación de transferencia fragmentada (chunked Transfer-Encoding) causa una asignación de memoria ilimitada y la caída del proceso. La función ChunkedDecoder::read_payload en cpp-httplib (httplib.h) analiza el campo de tamaño de fragmento de la codificación de transferencia fragmentada HTTP utilizando std::strtoul(). Según el estándar C (§7.22.1.4), strtoul acepta silenciosamente un signo menos inicial, realizando un desbordamiento sin signo: strtoul('-2', ..., 16) devuelve ULONG_MAX ? 1 (0xFFFFFFFFFFFFFFFE). La única protección de la biblioteca (línea 12833) rechaza ULONG_MAX (el resultado de '-1'), pero cualquier otro valor negativo como '-2' pasa la validación. El valor casi máximo resultante se almacena en chunk_remaining y controla cuántos bytes el bucle de lectura del servidor consume de la red. Esta vulnerabilidad está corregida en la 0.43.4.","source":"nvd"}],"published":"2026-05-29T19:14:08.065Z","modified":"2026-07-22T06:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-20","CWE-770","CWE-1285"],"affected":[{"ranges":[{"version":"< 0.43.4","status":"affected"}],"vendor":"yhirose","product":"cpp-httplib","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"0.43.4"}],"vendor":"yhirose","product":"cpp-httplib","cpe":"cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-h6wq-j5mv-f3q8","tags":["exploit","vendor-advisory","x-refsource-confirm"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-06-02T01:51:40.756Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45352","url":"https://www.cve.org/CVERecord?id=CVE-2026-45352","licence":"CVE Terms of Use","modified":"2026-06-02T01:52:12.106Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45352","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45352","licence":"Public domain","modified":"2026-07-22T06:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:23.367Z","epss":{"score":0.00327,"percentile":0.27847,"date":"2026-12-02T12:00:21.000Z"}}