CVE-2025-69220
Executive Summary
CVE-2025-69220 is a critical access control vulnerability in LibreChat, an open-source ChatGPT clone. The flaw, present in version 0.8.1-rc2, allows an authenticated attacker with knowledge of an agent ID to upload arbitrary files to that agent's file context or file search, even without explicit permissions. This enables unauthorized modification of agent behavior, potentially leading to data poisoning, malicious file injection, or service disruption. The vulnerability has a CVSS score of 7.1 (High) and is fixed in version 0.8.2-rc2. No public exploit code or proof-of-concept is currently available, but the risk is elevated due to the ease of exploitation and the potential for lateral movement within a compromised environment.
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 distributed via GitHub and Docker. The vulnerability is in the application's own code, not in a third-party package. However, organizations using LibreChat should verify the integrity of their deployment, especially if pulling from unofficial sources. The fix is included in the official release 0.8.2-rc2.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
- Base Score: 7.1 (High)
- Attack Vector (AV): Network (N) - Exploitable remotely.
- Attack Complexity (AC): Low (L) - No special conditions required.
- Privileges Required (PR): Low (L) - Attacker needs valid authentication.
- User Interaction (UI): None (N) - No user action needed.
- Scope (S): Unchanged (U) - Impact confined to the vulnerable component.
- Confidentiality (C): None (N) - No data exposure.
- Integrity (I): High (H) - Attacker can modify agent behavior.
- Availability (A): Low (L) - Potential for denial of service via malicious file uploads.
Threat Level: High. The low attack complexity and network exploitability make this a prime target for automated scanning and exploitation by threat actors.
Deep Dive & Mechanics
The vulnerability resides in the file upload functionality for agent file contexts and file search. LibreChat uses an agent-based architecture where each agent has a unique ID. The intended access control should verify that the authenticated user has the necessary permissions (e.g., "write" or "manage") for the target agent before allowing file uploads.
In version 0.8.1-rc2, the authorization check is missing or improperly implemented. When a user initiates a file upload to an agent's file context or file search, the application only validates the user's authentication token but does not verify if the user is authorized to modify that specific agent. An attacker can enumerate or guess agent IDs (e.g., via API endpoints, logs, or brute-force) and then send a crafted HTTP request to upload a file.
The uploaded file can be of any type (e.g., PDF, text, image) and is processed by the agent's context. This can alter the agent's behavior, for example:
- Injecting malicious instructions or prompts.
- Overwriting legitimate context files with poisoned data.
- Causing the agent to output incorrect or harmful information.
- Potentially leading to server-side attacks if the file is processed unsafely (e.g., XXE, SSRF).
The fix in version 0.8.2-rc2 adds proper authorization checks, ensuring that only users with explicit permissions for the target agent can upload files.
Vulnerable vs. Patched Code
The following is a conceptual comparison based on the vulnerability description. Actual code may differ.
Vulnerable Code (0.8.1-rc2):
// routes/agent.js
router.post('/agent/:agentId/upload', authenticate, async (req, res) => {
const { agentId } = req.params;
const file = req.files.file;
// Missing authorization check
const result = await agentService.uploadFile(agentId, file);
res.json({ success: true, data: result });
});
Patched Code (0.8.2-rc2):
// routes/agent.js
router.post('/agent/:agentId/upload', authenticate, authorizeAgent, async (req, res) => {
const { agentId } = req.params;
const file = req.files.file;
// Authorization check added
const result = await agentService.uploadFile(agentId, file);
res.json({ success: true, data: result });
});
// middleware/authorize.js
function authorizeAgent(req, res, next) {
const { agentId } = req.params;
const userId = req.user.id;
if (!agentPermissions.hasAccess(userId, agentId, 'write')) {
return res.status(403).json({ error: 'Forbidden' });
}
next();
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Valid user credentials for a LibreChat instance.
- Knowledge of a target agent ID (e.g.,
agent_12345).
Exploitation Steps:
Enumerate Agent IDs: Use the LibreChat API to list agents or brute-force IDs if the pattern is predictable.
curl -X GET https://target.com/api/agents -H "Authorization: Bearer <token>"Upload Malicious File: Send a POST request to the vulnerable endpoint with a crafted file.
curl -X POST https://target.com/api/agent/agent_12345/upload \ -H "Authorization: Bearer <token>" \ -F "file=@malicious.txt"Verify Impact: Interact with the agent to confirm the file was processed and altered behavior.
Lab Setup:
- Deploy LibreChat 0.8.1-rc2 using Docker:
docker run -d -p 3000:3000 --name librechat-vuln librechat/librechat:0.8.1-rc2 - Create a test user and agent via the UI.
- Execute the exploitation steps above.
Blue Team
Detection:
- Monitor for unusual file uploads to agent endpoints, especially from users who do not normally interact with that agent.
- Look for repeated failed authorization attempts (403 errors) followed by successful uploads.
- Analyze uploaded files for malicious content (e.g., scripts, unexpected MIME types).
Hunting Queries:
- Search logs for
POST /api/agent/*/uploadwith a200response code from users with low privileges. - Correlate agent ID access patterns with user roles.
Indicators of Compromise (IOCs)
- Network:
- HTTP POST requests to
/api/agent/*/uploadwith a200response. - Unusual file types in uploads (e.g.,
.exe,.sh,.ps1).
- HTTP POST requests to
- Host:
- Unexpected files in the agent's file context directory (e.g.,
/app/uploads/agents/). - Modified agent behavior or output.
- Unexpected files in the agent's file context directory (e.g.,
- Logs:
- Absence of authorization checks in access logs for agent uploads.
- Repeated agent ID enumeration attempts.
Detection Engineering
YARA Rule
rule CVE_2025_69220_LibreChat_Upload_Abuse {
meta:
description = "Detects malicious file uploads targeting LibreChat agent context"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-69220"
strings:
$s1 = "/api/agent/" ascii wide nocase
$s2 = "/upload" ascii wide nocase
$s3 = "multipart/form-data" ascii wide nocase
condition:
all of them
}
Sigma Rule
title: CVE-2025-69220 - Unauthorized Agent File Upload
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to upload files to LibreChat agents without proper authorization
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'POST'
cs-uri-stem|contains: '/api/agent/'
cs-uri-stem|endswith: '/upload'
sc-status: 200
condition: selection
falsepositives:
- Legitimate file uploads by authorized users
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-69220 - LibreChat Unauthorized Agent File Upload"; flow:to_server,established; content:"POST"; http_method; content:"/api/agent/"; http_uri; content:"/upload"; http_uri; content:"multipart/form-data"; http_client_body; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade LibreChat to version 0.8.2-rc2 or later.
- Restrict network access to the LibreChat instance to trusted IPs only.
- Review and revoke any suspicious user accounts or API tokens.
Long-term:
- Implement additional authorization checks for all agent-related operations.
- Enable detailed logging and monitoring for file uploads.
- Conduct regular security audits and penetration testing.
- Consider using a Web Application Firewall (WAF) to block anomalous upload patterns.
Workaround: If upgrading is not immediately possible, disable the file upload feature for agents by modifying the application configuration or using a reverse proxy to block the vulnerable endpoint.
Valters IT
Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.