Direct naar de inhoud
⚡ Kritieke cyberalerts voor jouw sector & systemen — direct in je inbox. Aanmelden →
CVE's Videos Dagbriefing

← Terug naar CVE-database

CVE-2026-45352

MEDIUM · 5.3 CVSS Gepubliceerd: CWE-20

Beschrijving NL

cpp-httplib is een C++11 header-only cross-platform HTTP/HTTPS-bibliotheek met één bestand. Voorafgaand aan 0.43.4 veroorzaakt negatieve chunk-size in chunked Transfer-Encoding onbegrensde geheugentoewijzing en procescrash. De ChunkedDecoder::read_payload functie in cpp-httplib (Зplib.h) ontleedt het chunk-size veld van HTTP chunked transfer codering met behulp van std::strtoul(). Volgens de C-standaard (§ 7.22.1.4) accepteert strtoul stilletjes een voorloop minteken en voert het een niet-ondertekende wrap-around uit: strtoul ("-2", …, 16) geeft ULONG_MAX − 1 (0xFFFFFFFFFFFFFFFFF) terug. De enige bewaker van de bibliotheek (regel 12833) verwerpt ULONG_MAX (het resultaat van "-1"), maar elke andere negatieve waarde zoals "-2" slaagt voor validatie. De resulterende bijna-maximale waarde wordt opgeslagen in chunk_remaining en bepaalt hoeveel bytes de leeslus van de server van het netwerk verbruikt. Deze kwetsbaarheid is opgelost in 0.43.4.

Origineel (Engels) tonen

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.

Vendors

Yhirose

Affected products

Cpp-httplib

References