CVE-2025-46728 Details
Description
cpp-httplib is a C++ header-only HTTP/HTTPS server and client library. Prior to version 0.20.1, the library fails to enforce configured size limits on incoming request bodies when `Transfer-Encoding: chunked` is used or when no `Content-Length` header is provided. A remote attacker can send a chunked request without the terminating zero-length chunk, causing uncontrolled memory allocation on the server. This leads to potential exhaustion of system memory and results in a server crash or unresponsiveness. Version 0.20.1 fixes the issue by enforcing limits during parsing. If the limit is exceeded at any point during reading, the connection is terminated immediately. A short-term workaround through a Reverse Proxy is available. If updating the library immediately is not feasible, deploy a reverse proxy (e.g., Nginx, HAProxy) in front of the `cpp-httplib` application. Configure the proxy to enforce maximum request body size limits, thereby stopping excessively large requests before they reach the vulnerable library code.
A denial-of-service vulnerability has been identified in cpp-httplib, a C++ header-only HTTP/HTTPS server and client library, in versions prior to 0.20.1. The issue arises because the library does not properly enforce size limits on incoming request bodies when 'Transfer-Encoding: chunked' is used or when the 'Content-Length' header is absent. This flaw allows remote attackers to send chunked requests without the required terminating zero-length chunk, leading to uncontrolled memory allocation on the server. Consequently, this can cause system memory exhaustion, resulting in a server crash or unresponsiveness. The vulnerability exists before request routing is completed, affecting all requests, including those to non-existent paths.
Users can update to cpp-httplib version 0.20.1 or later, which addresses the vulnerability by enforcing size limits during the parsing of chunked requests. If an update is not immediately feasible, a reverse proxy such as Nginx or HAProxy can be deployed in front of the cpp-httplib application to enforce maximum request body size limits, blocking excessively large requests before they reach the vulnerable library code.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 6, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-400 | Uncontrolled Resource Consumption | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| cpp-httplib project cpp-httplib | < 0.20.1 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Aug 1, 2025 | Initial Analysis | [email protected] |
| May 6, 2025 | New CVE Received | [email protected] |