CVE-2025-8849
Executive Summary
CVE-2025-8849 is a Denial of Service (DoS) vulnerability affecting LibreChat version 0.7.9. The flaw resides in the /api/memories endpoint, where the key and value parameters accept arbitrarily large inputs without proper validation. Submitting excessively large values triggers a null pointer error in the Rust-based backend, preventing the creation of new memories and degrading service stability. The CVSS score is 5.4 (Medium), with a low attack complexity and no authentication required. No public exploit code or patch is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
LibreChat is a Node.js application with a Rust-based backend component. The vulnerability is not directly related to a package manager (NPM, PyPI, Go, Ruby) but involves the Rust backend's memory handling. The risk of supply chain compromise is low, but the lack of a patch increases operational risk.
CVSS Breakdown & Threat Level
- CVSS Score: 5.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: None
- Availability Impact: Low
The threat level is medium due to the ease of exploitation (no authentication, low complexity) and the potential for service disruption. The EPSS score of 0.0% indicates low exploitation likelihood in the wild, but this may change as details become public.
Deep Dive & Mechanics
The vulnerability is a classic case of unbounded input leading to resource exhaustion. The /api/memories endpoint accepts key and value parameters. Without size limits, an attacker can send extremely large strings (e.g., megabytes of data). The Rust backend, which processes these inputs, attempts to allocate memory for the values. When the input exceeds available memory or triggers a null pointer dereference due to failed allocation, the backend crashes or enters an error state, preventing new memories from being created.
The root cause is the lack of input validation and size limits on the key and value parameters. The Rust backend likely uses a function that does not handle large allocations gracefully, leading to a null pointer error.
Vulnerable vs. Patched Code
Vulnerable Code (LibreChat 0.7.9):
// Example of vulnerable endpoint handler (simplified)
app.post('/api/memories', (req, res) => {
const { key, value } = req.body;
// No size validation
rustBackend.createMemory(key, value);
res.status(200).send('Memory created');
});
Patched Code (Hypothetical):
// Example of patched endpoint handler
app.post('/api/memories', (req, res) => {
const { key, value } = req.body;
// Validate input size
if (key.length > 256 || value.length > 1024) {
return res.status(400).send('Input too large');
}
rustBackend.createMemory(key, value);
res.status(200).send('Memory created');
});
The patch would involve adding input size validation in the Node.js layer before passing data to the Rust backend.
Exploitation & Lab Setup
Red Team
- Setup: Deploy LibreChat 0.7.9 in a controlled environment (e.g., Docker container).
- Exploit: Send a POST request to
/api/memorieswith an extremely largekeyorvalueparameter.
# Example using curl
curl -X POST http://target:3080/api/memories \
-H "Content-Type: application/json" \
-d '{"key": "A", "value": "'$(python3 -c 'print("A"*1000000)')'"}'
- Observation: The service becomes unresponsive or returns errors for subsequent memory creation requests.
Blue Team
- Detection: Monitor for unusually large POST request bodies to
/api/memories. - Mitigation: Implement input size limits at the reverse proxy (e.g., Nginx
client_max_body_size). - Response: Restart the LibreChat service if it becomes unresponsive.
Indicators of Compromise (IOCs)
- Network: POST requests to
/api/memorieswith body size > 1 MB. - Logs: Error logs from Rust backend indicating null pointer or memory allocation failure.
- System: High memory usage on the LibreChat server.
Detection Engineering
YARA Rule
rule CVE_2025_8849_LibreChat_DoS {
meta:
description = "Detects exploit attempts for CVE-2025-8849"
author = "Valters IT"
date = "2025-04-01"
strings:
$http_post = "POST /api/memories"
$large_body = /"value"\s*:\s*"[A-Za-z0-9]{1000,}/
condition:
$http_post and $large_body
}
Sigma Rule
title: CVE-2025-8849 LibreChat DoS Exploit Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects large POST requests to /api/memories
author: Valters IT
logsource:
category: webserver
product: nginx
detection:
selection:
http.method: POST
http.url: "/api/memories"
http.body_length: ">1000000"
condition: selection
falsepositives:
- Legitimate large memory entries (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-8849 LibreChat DoS Exploit Attempt"; flow:to_server; http.method; content:"POST"; http.uri; content:"/api/memories"; http.request_body; content:"value"; pcre:"/\"value\"\s*:\s*\"[A-Za-z0-9]{1000,}/"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Restrict access to the
/api/memoriesendpoint using a Web Application Firewall (WAF) or reverse proxy (e.g., Nginxclient_max_body_size 1M). - Short-term: Implement input validation in the Node.js layer to limit
keyandvaluesizes. - Long-term: Apply the official patch when released by LibreChat. Monitor the vendor's GitHub repository for updates.
- Workaround: Disable the memories feature if not critical.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert