Skip to main content
VulnerabilityPublished Updated

CVE-2026-31870: yhirose cpp-httplib · Uncaught Exception

Affects yhirose cpp-httplibSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 7.5 High : upgrade to 0.37.1 soon.

Data as of 30 Oct 2026, 11:52 UTC

CVSS 3.1 base score
7.5High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.4% chance of exploitation in 30 days – higher than 40% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 0.37.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 11 Mar 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Upgrade cpp-httplib and yhirose/cpp-httplib to 0.37.1.

Affected software

ProductAffectedFixed in
yhirosecpp-httplibAffected
  • <0.37.1
Fixed in
  • 0.37.1
GitHubyhirose/cpp-httplibpkg:github/yhirose/cpp-httplibOther threatsAffected
  • <0.37.1
Fixed in
  • 0.37.1

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

To mitigate CVE-2026-31870, organizations should upgrade all instances of cpp-httplib to version 0.37.1 or later, where the vulnerability is fixed. If upgrading immediately is not feasible, developers should implement input validation and exception handling around the parsing of the Content-Length header in their client code to catch std::invalid_argument and std::out_of_range exceptions from std::stoull. Additionally, applying network-level controls such as validating HTTP responses from trusted servers, employing TLS with certificate validation to prevent man-in-the-middle attacks, and filtering or sanitizing HTTP headers can reduce exposure. Monitoring client application logs for unexpected crashes and implementing automated restarts or failover mechanisms can help maintain availability. Finally, conducting code reviews and fuzz testing on HTTP header parsing logic in custom integrations can identify similar issues proactively.

Description

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.37.1, when a cpp-httplib client uses the streaming API (httplib::stream::Get, httplib::stream::Post, etc.), the library calls std::stoull() directly on the Content-Length header value received from the server with no input validation and no exception handling.std::stoull throws std::invalid_argument for non-numeric strings and std::out_of_range for values exceeding ULLONG_MAX. Since nothing catches these exceptions, the C++ runtime calls std::terminate(), which kills the process with SIGABRT. Any server the client connects to — including servers reached via HTTP redirects, third-party APIs, or man-in-the-middle positions can crash the client application with a single HTTP response. No authentication is required. No interaction from the end user is required. The crash is deterministic and immediate. This vulnerability is fixed in 0.37.1.

References

Community reviews

Loading reviews…