CVE-2024-10366
📋 TL;DR
This CVE describes an Insecure Direct Object Reference (IDOR) vulnerability in LibreChat's delete attachments functionality. Authenticated users can delete other users' attachments by manipulating attachment IDs. All LibreChat instances running the affected version are vulnerable.
💻 Affected Systems
- danny-avila/librechat
📦 What is this software?
Librechat by Librechat
⚠️ Risk & Real-World Impact
Worst Case
Malicious authenticated users could systematically delete all user attachments, causing data loss and potential service disruption if critical files are affected.
Likely Case
Targeted deletion of specific users' attachments, potentially for harassment, data destruction, or covering tracks after other attacks.
If Mitigated
With proper access controls, users can only delete their own attachments, preventing unauthorized data modification.
🎯 Exploit Status
Exploitation requires authenticated access but is trivial via simple HTTP request manipulation. No special tools needed.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Fixed in commit a350443661d001ac55787741969a75d94ca14116
Vendor Advisory: https://github.com/danny-avila/librechat/commit/a350443661d001ac55787741969a75d94ca14116
Restart Required: Yes
Instructions:
1. Update LibreChat to version after commit a350443661d001ac55787741969a75d94ca14116. 2. Restart the application. 3. Verify the fix by testing attachment deletion with different user accounts.
🔧 Temporary Workarounds
Disable attachment deletion
allTemporarily disable the delete attachments endpoint until patching is complete
Modify application configuration to remove/disable DELETE /api/attachments/{id} endpoint
Implement middleware validation
allAdd server-side validation to check attachment ownership before processing deletion requests
Add ownership verification in attachment deletion handler: if (attachment.user_id !== current_user.id) return 403
🧯 If You Can't Patch
- Implement web application firewall (WAF) rules to detect and block suspicious attachment deletion patterns
- Enable detailed logging of all attachment deletion attempts and monitor for unauthorized access patterns
🔍 How to Verify
Check if Vulnerable:
Test with two authenticated user accounts: User A attempts to delete User B's attachment by manipulating the attachment ID in the DELETE request. If successful, system is vulnerable.
Check Version:
Check LibreChat version in package.json or via application admin interface
Verify Fix Applied:
Repeat the vulnerability test. After patching, User A should receive a 403 Forbidden error when attempting to delete User B's attachment.
📡 Detection & Monitoring
Log Indicators:
- Multiple failed attachment deletion attempts with 403 errors
- Attachment deletion requests where user ID doesn't match attachment owner
- Unusual patterns of attachment deletions across different user accounts
Network Indicators:
- HTTP DELETE requests to /api/attachments/{id} with rapid succession
- DELETE requests from single IP targeting multiple user attachment IDs
SIEM Query:
source="librechat" AND method="DELETE" AND uri="/api/attachments/*" | stats count by src_ip, user_id, attachment_id