CVE-2025-53629

7.5 HIGH

📋 TL;DR

This vulnerability in cpp-httplib allows attackers to send specially crafted HTTP requests with Transfer-Encoding: chunked headers that cause uncontrolled memory allocation, potentially leading to server memory exhaustion and denial of service. It affects all systems using cpp-httplib versions before 0.23.0 that process HTTP requests.

💻 Affected Systems

Products:
  • cpp-httplib
Versions: All versions prior to 0.23.0
Operating Systems: All platforms where cpp-httplib is used
Default Config Vulnerable: ⚠️ Yes
Notes: This affects any application using cpp-httplib as an HTTP server that processes incoming requests. The vulnerability is in the library itself, not dependent on specific configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server memory exhaustion leading to denial of service, potentially causing application crashes and service unavailability.

🟠

Likely Case

Degraded server performance, memory exhaustion, and denial of service affecting application availability.

🟢

If Mitigated

Limited impact with proper memory limits and monitoring, but still vulnerable to targeted attacks.

🌐 Internet-Facing: HIGH - Any internet-facing server using vulnerable cpp-httplib can be targeted with unauthenticated HTTP requests.
🏢 Internal Only: MEDIUM - Internal systems are still vulnerable but have reduced attack surface compared to internet-facing systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending HTTP requests with Transfer-Encoding: chunked headers, which is straightforward for attackers with network access to vulnerable servers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.23.0

Vendor Advisory: https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-j6p8-779x-p5pw

Restart Required: Yes

Instructions:

1. Update cpp-httplib to version 0.23.0 or later. 2. Replace the single header file in your project with the patched version. 3. Recompile and restart your application.

🔧 Temporary Workarounds

Implement request size limits

all

Configure HTTP server to limit maximum request size and chunk sizes

// In cpp-httplib server configuration, set request size limits
svr.set_payload_max_length(1048576); // Example: 1MB limit

Filter Transfer-Encoding headers

all

Implement middleware to reject or sanitize Transfer-Encoding headers

// Add request handler to check headers
svr.Post("/", [](const Request &req, Response &res) {
  if (req.has_header("Transfer-Encoding")) {
    res.status = 400; // Bad Request
    return;
  }
  // Process request normally
});

🧯 If You Can't Patch

  • Implement network-level protections such as WAF rules to block or limit Transfer-Encoding: chunked requests
  • Deploy memory monitoring and alerting to detect abnormal memory consumption patterns

🔍 How to Verify

Check if Vulnerable:

Check if your application uses cpp-httplib version earlier than 0.23.0 by examining the header file version or build configuration.

Check Version:

grep -n "CPPHTTPLIB_VERSION" httplib.h | head -1

Verify Fix Applied:

Verify the cpp-httplib header file contains the fix from commit 17ba303889b8d4d719be3879a70639ab653efb99 and version is 0.23.0 or higher.

📡 Detection & Monitoring

Log Indicators:

  • Unusually large memory consumption by HTTP server process
  • Multiple HTTP requests with Transfer-Encoding: chunked headers
  • Server crashes or restarts following HTTP requests

Network Indicators:

  • HTTP requests with Transfer-Encoding: chunked headers to vulnerable endpoints
  • Abnormally large HTTP request payloads

SIEM Query:

source="web_server" AND (http_header="Transfer-Encoding: chunked" OR memory_usage>90%)

🔗 References

📤 Share & Export