CVE-2026-45352: CWE-20: Improper Input Validation in yhirose cpp-httplib
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.
AI Analysis
Technical Summary
The cpp-httplib library, a C++11 single-file header-only HTTP/HTTPS library, improperly validates the chunk-size field in HTTP chunked transfer encoding. The function uses std::strtoul() which accepts a leading minus sign and wraps the value unsigned, causing negative chunk sizes like "-2" to be interpreted as near-maximum unsigned values. This value is stored in chunk_remaining and controls the number of bytes read from the network, leading to unbounded memory allocation and a process crash. The vulnerability affects versions prior to 0.43.4 and is resolved in 0.43.4.
Potential Impact
An attacker can supply a negative chunk-size value (other than -1) in chunked Transfer-Encoding, causing the library to allocate excessive memory and potentially crash the process using cpp-httplib. This results in a denial of service (DoS) condition. There is no impact on confidentiality or integrity according to the CVSS vector.
Mitigation Recommendations
Upgrade to cpp-httplib version 0.43.4 or later where this vulnerability is fixed. Patch status is confirmed by the vendor's versioning information. No additional mitigations are indicated.
CVE-2026-45352: CWE-20: Improper Input Validation in yhirose cpp-httplib
Description
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.
CVSS v3.1
Score 5.3medium
Affected software
pkg:github/yhirose/cpp-httplibRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The cpp-httplib library, a C++11 single-file header-only HTTP/HTTPS library, improperly validates the chunk-size field in HTTP chunked transfer encoding. The function uses std::strtoul() which accepts a leading minus sign and wraps the value unsigned, causing negative chunk sizes like "-2" to be interpreted as near-maximum unsigned values. This value is stored in chunk_remaining and controls the number of bytes read from the network, leading to unbounded memory allocation and a process crash. The vulnerability affects versions prior to 0.43.4 and is resolved in 0.43.4.
Potential Impact
An attacker can supply a negative chunk-size value (other than -1) in chunked Transfer-Encoding, causing the library to allocate excessive memory and potentially crash the process using cpp-httplib. This results in a denial of service (DoS) condition. There is no impact on confidentiality or integrity according to the CVSS vector.
Mitigation Recommendations
Upgrade to cpp-httplib version 0.43.4 or later where this vulnerability is fixed. Patch status is confirmed by the vendor's versioning information. No additional mitigations are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-11T21:40:08.178Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a19e68ee29bf47b50037d67
Added to database: 05/29/2026, 19:18:38 UTC
Last enriched: 06/05/2026, 20:52:44 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 83
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.