CVE-2024-3110
📋 TL;DR
A stored XSS vulnerability in anything-llm allows attackers with manager role to inject malicious JavaScript via crafted URLs. When an admin clicks these links, their authorization token can be stolen, leading to account takeover. This affects versions up to and including the latest before 1.0.0.
💻 Affected Systems
- mintplex-labs/anything-llm
📦 What is this software?
Anythingllm by Mintplexlabs
⚠️ Risk & Real-World Impact
Worst Case
Complete admin account takeover leading to full system compromise, data theft, and privilege escalation across the application.
Likely Case
Admin session hijacking allowing unauthorized actions, privilege escalation, and potential data exfiltration.
If Mitigated
Limited impact with proper input validation and output encoding preventing JavaScript execution.
🎯 Exploit Status
Exploit requires manager role to create malicious links, but execution is simple via link clicks.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.0.0 and later
Vendor Advisory: https://github.com/mintplex-labs/anything-llm/commit/49f30e051c9f6e28977d57d0e5f49c1294094e41
Restart Required: Yes
Instructions:
1. Update to version 1.0.0 or later. 2. Restart the application. 3. Verify the fix by checking that javascript: protocol URLs are blocked.
🔧 Temporary Workarounds
Input Validation Filter
allAdd server-side validation to reject URLs containing javascript: protocol
Implement URL validation in the application code to filter out javascript: protocol
Content Security Policy
allImplement CSP headers to restrict script execution
Add Content-Security-Policy header with script-src 'self'
🧯 If You Can't Patch
- Restrict manager role permissions to trusted users only
- Implement web application firewall rules to block javascript: protocol in URLs
🔍 How to Verify
Check if Vulnerable:
Check if application version is below 1.0.0 and test if javascript:alert('XSS') can be injected in URL fields.
Check Version:
Check package.json or application settings for version number
Verify Fix Applied:
After updating to 1.0.0+, attempt to inject javascript: protocol URLs and verify they are rejected.
📡 Detection & Monitoring
Log Indicators:
- Unusual URL patterns containing javascript: protocol
- Multiple failed URL validation attempts
Network Indicators:
- Outbound requests to unknown servers following admin link clicks
- Unexpected token transmission to external domains
SIEM Query:
search 'javascript:' in URL fields OR outbound connections following admin link clicks
🔗 References
- https://github.com/mintplex-labs/anything-llm/commit/49f30e051c9f6e28977d57d0e5f49c1294094e41
- https://huntr.com/bounties/c2895978-364d-412d-8825-c806606bcb85
- https://github.com/mintplex-labs/anything-llm/commit/49f30e051c9f6e28977d57d0e5f49c1294094e41
- https://huntr.com/bounties/c2895978-364d-412d-8825-c806606bcb85