Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-45352: CWE-20: Improper Input Validation in yhirose cpp-httplib

0
Medium
VulnerabilityCVE-2026-45352cvecve-2026-45352cwe-20cwe-1285cwe-770
Published: Fri May 29 2026 (05/29/2026, 19:14:08 UTC)
Source: CVE Database V5
Vendor/Project: yhirose
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/29/2026, 19:33:56 UTC

Technical Analysis

The cpp-httplib C++11 header-only HTTP/HTTPS library versions before 0.43.4 improperly validate the chunk-size field in HTTP chunked transfer encoding. The function ChunkedDecoder::read_payload uses std::strtoul() to parse chunk sizes, which per C standard accepts a leading minus sign and performs unsigned wrap-around. While the library rejects the value for "-1", other negative values like "-2" pass validation, resulting in a near-maximum unsigned value being assigned to chunk_remaining. This causes the server to allocate excessive memory and potentially crash during the read loop. The vulnerability is addressed in version 0.43.4.

Potential Impact

An attacker can send a chunked HTTP request with a negative chunk-size (other than "-1") that passes validation and causes the server to allocate an extremely large amount of memory. This leads to unbounded memory allocation and a denial of service via process crash. There is no impact on confidentiality or integrity reported. The CVSS score is 5.3 (medium severity) reflecting a network attack vector, no privileges required, no user interaction, and impact limited to availability.

Mitigation Recommendations

Upgrade to cpp-httplib version 0.43.4 or later where this vulnerability is fixed. Patch status is not explicitly stated in the vendor advisory, but the description confirms the issue is resolved in 0.43.4. No other mitigations are indicated.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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: 5/29/2026, 7:18:38 PM

Last enriched: 5/29/2026, 7:33:56 PM

Last updated: 5/29/2026, 8:23:37 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses