Security Resilience

CVE-2026-31870

Yhirose Cpp-Httplib ≤ 0.37.1

Public PoC
Published
11 March 2026
Modified
18 March 2026
Patch / advisory
CVSS Score v3.1 7.5
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Score 0.0064 45th percentile
Risk Priority 58 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2026-31870 is a high-severity Uncaught Exception (CWE-248) vulnerability in Yhirose Cpp-Httplib. Its CVSS base score is 7.5 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Endpoint Denial of Service (T1499); ranked at the 45th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

The strongest mitigations our analysis identified map to SA-8 (Security and Privacy Engineering Principles) and SC-24 (Fail in Known State) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2026-31870 is a vulnerability in cpp-httplib, a C++11 single-file header-only cross-platform HTTP/HTTPS library, affecting versions prior to 0.37.1. It arises when a client uses the streaming API, such as httplib::stream::Get or httplib::stream::Post. The library invokes std::stoull() directly on the Content-Length header value received from the server without input validation or exception handling. Non-numeric strings trigger std::invalid_argument, while values exceeding ULLONG_MAX trigger std::out_of_range; uncaught exceptions lead to std::terminate(), terminating the process with SIGABRT.

Any server the client connects to—including those via HTTP redirects, third-party APIs, or man-in-the-middle positions—can exploit this by sending a single HTTP response with a malformed Content-Length header, crashing the client application deterministically and immediately. No authentication or end-user interaction is required, enabling remote denial-of-service. The CVSS v3.1 base score is 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H), mapped to CWE-248.

The issue is addressed in cpp-httplib version 0.37.1. Additional details are available in the GitHub security advisory at https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-39q5-hh6x-jpxx.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

T1499 Endpoint Denial of Service Impact
Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade or block the availability of services to users.
T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
T1687 Exploitation for Defense Impairment Defense Impairment
Adversaries may exploit vulnerabilities in security software, infrastructure, or defensive components to degrade, disable, or otherwise continue to impair their ability to prevent, detect, or respond to malicious activity.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-22776Same product: Yhirose Cpp-Httplib
CVE-2026-28435Same product: Yhirose Cpp-Httplib
CVE-2026-29076Same product: Yhirose Cpp-Httplib
CVE-2026-46527Same product: Yhirose Cpp-Httplib
CVE-2025-53629Same product: Yhirose Cpp-Httplib
CVE-2025-53628Same product: Yhirose Cpp-Httplib
CVE-2026-45352Same product: Yhirose Cpp-Httplib
CVE-2026-34441Same product: Yhirose Cpp-Httplib
CVE-2026-45372Same product: Yhirose Cpp-Httplib
CVE-2026-32627Same product: Yhirose Cpp-Httplib

Affected Assets

yhirose
cpp-httplib
≤ 0.37.1

Mitigating Controls

Mitigating Controls (NIST 800-53 r5)

Our mappings, made for this CVE.

Security engineering principles include robust exception management to keep the system in a defined state.

Fail-in-known-state reduces the impact when an uncaught exception occurs by preserving a safe condition.

Error handling requirements force structured catching and response to exceptions instead of allowing them to propagate uncaught.

Mitigating Controls (NIST CSF 2.0)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 mostly match
blocks

Secure SDLC practices explicitly require structured exception handling to prevent uncaught exceptions from reaching production.

Mitigating Controls (ISO/IEC 27001:2022 Annex A)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

Security testing can detect uncaught exceptions before production deployment.

prevents

Training developers in exception handling reduces uncaught-exception defects, but it is a fallible human practice and the strongest controls for this implementation-phase code defect are code review and static analysis (A.8.28/A.8.29), so only a minority of instances are prevented.

prevents

Secure coding standards directly require catching and handling exceptions to prevent crashes or leaks.

prevents

A.8.30 carries its effect through the secure design, coding and testing practices (8.25-8.29) its contract requires of the supplier, so an outsourced implementation that omits exception handling is reduced the way those practices reduce it; the owner graded the same clause against CWE-134 at `partial` on this verb, and CWE-248 is the same kind of regular implementation-phase software weakness, with the same fallible-supplier-practice remainder.

finds

A.8.8 discovers vulnerabilities through published advisories and scanning tools, which surface known flaws in third-party components, but an uncaught exception is a code-level defect in first-party implementation that is not disclosed as a CVE and is invisible to vulnerability management's disclosure-based reach.

References