# CVE-2025-46728: cpp-httplib has Unbounded Memory Allocation in Chunked/No-Length Requests

> Remote attackers can exhaust server memory via unbounded chunked requests in cpp-httplib, causing denial of service.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 May 2025
- **Updated:** 6 May 2025
- **Also known as:** DEBIAN-CVE-2025-46728, ECHO-f24e-40e5-ba8e, GHSA-px83-72rx-v57c, OESA-2025-1610, OESA-2025-1611, OESA-2025-1612, OESA-2025-1613, UBUNTU-CVE-2025-46728, openSUSE-SU-2025:15084-1

## What is CVE-2025-46728?

CVE-2025-46728 is a high-severity denial of service vulnerability in yhirose cpp-httplib, published on 6 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2025-46728?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cpp-httplib` | openSUSE:Tumbleweed | All versions | 0.20.1-1.1 |

Products: Cpp-Httplib Project Cpp-Httplib.

## How do I fix CVE-2025-46728?

Upgrade to a fixed version.

## Is CVE-2025-46728 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-46728 exists.

## Other vulnerabilities in yhirose cpp-httplib

- [CVE-2023-26130](https://insights.sbomify.com/CVE-2023-26130/): Other in yhirose/cpp-httplib (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-46728 and fix it if it is affected.

What it is: CVE-2025-46728 is a high-severity denial of service vulnerability in yhirose cpp-httplib, published on 6 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-46728 exists.

Affected product: yhirose cpp-httplib. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-46728/ (Markdown: https://insights.sbomify.com/CVE-2025-46728/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-46728
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-46728
- OSV: https://osv.dev/vulnerability/CVE-2025-46728

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-46728/
Summaries are generated and may contain mistakes; the official description above is the record.
