CVE-2026-22776

7.5 HIGH

📋 TL;DR

A Denial of Service vulnerability exists in cpp-httplib where compressed HTTP request bodies are not properly limited after decompression. Attackers can send small compressed payloads that expand to consume excessive memory, potentially crashing affected services. This affects any application using vulnerable versions of cpp-httplib to handle HTTP requests with compression.

💻 Affected Systems

Products:
  • cpp-httplib
Versions: All versions prior to 0.30.1
Operating Systems: All platforms where cpp-httplib is used
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects deployments that accept HTTP requests with Content-Encoding headers (gzip, br, etc.).

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service outage due to memory exhaustion, potentially affecting multiple services on the same host through resource starvation.

🟠

Likely Case

Service degradation or crashes requiring restart, leading to temporary unavailability.

🟢

If Mitigated

Minimal impact with proper memory limits and monitoring in place.

🌐 Internet-Facing: HIGH - Internet-facing services accepting HTTP requests with compression are directly exploitable.
🏢 Internal Only: MEDIUM - Internal services could be exploited by authenticated users or compromised internal systems.

🎯 Exploit Status

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

Exploitation requires sending specially crafted HTTP requests with compressed bodies. The advisory includes proof-of-concept details.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.30.1

Vendor Advisory: https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-h934-98h4-j43q

Restart Required: Yes

Instructions:

1. Update cpp-httplib to version 0.30.1 or later. 2. Replace the header file in your project. 3. Recompile and redeploy affected applications. 4. Restart services using the library.

🔧 Temporary Workarounds

Disable compression support

all

Configure applications to reject HTTP requests with Content-Encoding headers

// In cpp-httplib configuration, set appropriate request handlers to reject compressed content

Implement memory limits

all

Add application-level memory monitoring and limits for request processing

🧯 If You Can't Patch

  • Implement network-level filtering to block or limit compressed HTTP 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 < 0.30.1 and accepts HTTP requests with Content-Encoding headers.

Check Version:

grep -r "cpp-httplib" your_source_code/ && check the header file version

Verify Fix Applied:

Verify cpp-httplib version is 0.30.1 or later in your codebase and test with compressed request payloads.

📡 Detection & Monitoring

Log Indicators:

  • Unusual memory consumption spikes
  • Service crashes/restarts
  • Large decompressed payload warnings

Network Indicators:

  • HTTP requests with Content-Encoding headers followed by abnormal response patterns
  • Repeated compressed requests to same endpoint

SIEM Query:

source="application_logs" AND ("out of memory" OR "crash" OR "restart") AND process="your_application"

🔗 References

📤 Share & Export