Critical Memory Allocation Vulnerability in cpp-httplib: Uncontrolled Memory Allocation via Chunked Requests

cpp-httplib Updated 02 Oct 2025

Summary

06/05/2025
N/A
No i
Unrated
Not published

DEBIAN-CVE-2025-46728: cpp-httplib is a C++ header-only HTTP/HTTPS server and client library. Affects cpp-httplib versions 0.11.4+ds-1 – 0.26.0+ds-2. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

cpp-httplib is a C++ header-only library designed for creating HTTP/HTTPS server and client applications. It is lightweight and easy to integrate, making it popular among developers for building web services. However, prior to version 0.20.1, cpp-httplib had a significant vulnerability that allowed attackers to exploit its handling of incoming request bodies, particularly when using 'Transfer-Encoding: chunked' or when the 'Content-Length' header was absent.

Vulnerability Detail

The vulnerability arises from cpp-httplib's failure to enforce size limits on incoming request bodies. This can lead to uncontrolled memory allocation when a remote attacker sends a chunked request without the required terminating zero-length chunk. The consequences of this vulnerability include potential exhaustion of system memory, which can cause the server to crash or become unresponsive. The issue has been addressed in version 0.20.1, which implements strict limits during the parsing of incoming requests.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If immediate updating is not feasible, a short-term workaround is to deploy a reverse proxy, such as Nginx or HAProxy, in front of your cpp-httplib application. Configure the proxy to enforce maximum request body size limits. For example, in Nginx, you can add the following configuration: 'client_max_body_size 1M;' to limit the request body size to 1 megabyte.

Conclusion

In summary, the cpp-httplib library has a critical vulnerability that can lead to uncontrolled memory allocation and server instability. It is crucial to update to version 0.20.1 or later to mitigate this risk. If immediate updates are not possible, implementing a reverse proxy can serve as a temporary workaround.

See every vulnerability recorded for cpp-httplib →

Share this vulnerability

FAQ

cpp-httplib is a C++ header-only library used for building HTTP/HTTPS server and client applications.

All versions prior to 0.20.1 are affected by this vulnerability.

If your application is vulnerable, it may experience uncontrolled memory allocation, leading to server crashes or unresponsiveness.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Check your application using the Vulert playground at Vulert Scanner without needing to sign up.

If you cannot update immediately, deploy a reverse proxy like Nginx or HAProxy to enforce maximum request body size limits as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for cpp-httplib.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback