CVE-2024-22086

9.8 CRITICAL

📋 TL;DR

CVE-2024-22086 is a critical stack-based buffer overflow vulnerability in cherry's HTTP request handler that allows remote attackers to execute arbitrary code by sending specially crafted long URIs. This affects all cherry deployments through version 4b877df. Any system running vulnerable cherry versions with HTTP services exposed is at risk of complete compromise.

💻 Affected Systems

Products:
  • cherry
Versions: All versions through commit 4b877df
Operating Systems: All platforms running cherry
Default Config Vulnerable: ⚠️ Yes
Notes: Any cherry deployment with HTTP services enabled is vulnerable. The vulnerability is in the core http.c component.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote unauthenticated attacker gains full system control, installs persistent backdoors, exfiltrates sensitive data, and pivots to other systems in the network.

🟠

Likely Case

Remote code execution leading to service disruption, data theft, and potential lateral movement within the network.

🟢

If Mitigated

Denial of service or application crash if buffer overflow protections are in place, but RCE prevented.

🌐 Internet-Facing: HIGH - Directly exploitable via HTTP requests without authentication.
🏢 Internal Only: HIGH - Internal attackers or compromised internal systems can exploit this with network access.

🎯 Exploit Status

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

Public GitHub issue demonstrates the vulnerability with example exploit code. Simple HTTP request with long URI triggers the overflow.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after commit 4b877df

Vendor Advisory: https://github.com/hayyp/cherry/issues/1

Restart Required: Yes

Instructions:

1. Update cherry to latest version after commit 4b877df. 2. Replace vulnerable http.c with patched version. 3. Restart cherry service. 4. Verify fix by testing with long URI requests.

🔧 Temporary Workarounds

URI Length Restriction

all

Implement web server or proxy restrictions on maximum URI length

nginx: 'client_max_body_size 1k;' in location block
apache: 'LimitRequestLine 1024' in config

Network Segmentation

linux

Restrict access to cherry HTTP ports using firewall rules

iptables -A INPUT -p tcp --dport [cherry_port] -s [trusted_ips] -j ACCEPT
iptables -A INPUT -p tcp --dport [cherry_port] -j DROP

🧯 If You Can't Patch

  • Deploy WAF with buffer overflow protection rules to block malicious long URIs
  • Isolate vulnerable systems in separate network segments with strict access controls

🔍 How to Verify

Check if Vulnerable:

Check cherry version/git commit hash. If at or before 4b877df, system is vulnerable.

Check Version:

cherry --version or check git commit hash in source

Verify Fix Applied:

Test with curl sending long URI: 'curl -v "http://target/$(python3 -c 'print("A"*2000)')"' - should not crash service.

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests with unusually long URIs (>1024 chars)
  • cherry process crashes/restarts
  • segmentation fault errors in logs

Network Indicators:

  • HTTP GET requests with URI length exceeding normal bounds
  • Multiple rapid long URI requests from single source

SIEM Query:

source="cherry.log" AND (uri_length>1024 OR "segmentation fault" OR "buffer overflow")

🔗 References

📤 Share & Export