CVE-2026-45352: yhirose cpp-httplib denial of service via negative chunk-size

CVE-2026-45352 · Severity: medium · CVSS 5.3 · Published 2026-05-29

cpp-httplib is a widely used C++ library that allows applications to handle web traffic (HTTP/HTTPS). A flaw in how the library processes data transfers allows a remote attacker to send a specially crafted request that forces the server to attempt to allocate an impossible amount of memory. This results in an immediate crash of the application, leading to a denial-of-service (DoS) where the service becomes unavailable to legitimate users.

Technologies: Yhirose Cpp-Httplib. Vendors: Yhirose.

Quick answers

Is CVE-2026-45352 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-45352 being exploited in the wild.
How severe is CVE-2026-45352?
Medium severity, with a CVSS score of 5.3, published 29 May 2026.
Which products and versions are affected?
Yhirose Cpp-Httplib < 0.43.4.
Is there a fix for CVE-2026-45352?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-45352 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-45352?
Check whether you run Yhirose Cpp-Httplib at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The ChunkedDecoder::read_payload function in httplib.h uses std::strtoul() to parse the chunk-size field of HTTP chunked transfer encoding. Because strtoul() performs unsigned wrap-around for negative inputs, a value such as '-2' is interpreted as a near-maximum unsigned long value (e.g., 0xFFFFFFFFFFFFFFFE). While the library explicitly checks for and rejects ULONG_MAX (the result of '-1'), it fails to validate other negative inputs. This causes the server to enter a read loop attempting to consume an extremely large amount of data, leading to unbounded memory allocation (std::bad_alloc) and a process crash. The vulnerability is fixed in version 0.43.4 by ensuring the parser correctly rejects non-hexadecimal characters like the leading minus sign.

Affected products

  • yhirose cpp-httplib < 0.43.4

Timeline

  • 2026-05-12: advisory: GitHub Security Advisory published
  • 2026-05-29: disclosed: CVE-2026-45352 published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.