CVE-2024-5125
📋 TL;DR
This vulnerability in lollms-webui version 9.6 allows attackers to upload malicious SVG files containing JavaScript code that executes when rendered, enabling cross-site scripting attacks and open redirects. Users who upload SVG files to the AI module are affected, potentially leading to credential theft and phishing attacks.
💻 Affected Systems
- parisneo/lollms-webui
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete account takeover, credential theft, malware distribution to all users, and reputation damage to the organization hosting the vulnerable instance.
Likely Case
Targeted phishing attacks against users, session hijacking, and unauthorized data access through malicious JavaScript execution.
If Mitigated
Limited impact with proper input validation and file type restrictions, potentially only affecting users who manually upload SVG files.
🎯 Exploit Status
Exploitation requires user interaction (uploading SVG file) but the attack vector is straightforward once access is obtained.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Fixed in commit 9b0f6c4ad1b9a2cd3466dcefaa278df30feed67e
Vendor Advisory: https://github.com/parisneo/lollms-webui/commit/9b0f6c4ad1b9a2cd3466dcefaa278df30feed67e
Restart Required: Yes
Instructions:
1. Update to latest lollms-webui version. 2. Apply commit 9b0f6c4ad1b9a2cd3466dcefaa278df30feed67e. 3. Restart the webui service.
🔧 Temporary Workarounds
Disable SVG file uploads
allTemporarily block SVG file uploads to the AI module
Modify webui configuration to reject .svg files
Implement Content Security Policy
allAdd CSP headers to prevent script execution from uploaded files
Add 'Content-Security-Policy: default-src 'self'' to web server headers
🧯 If You Can't Patch
- Disable file upload functionality to AI module completely
- Implement strict file type validation and sanitization for all uploaded files
🔍 How to Verify
Check if Vulnerable:
Check if running lollms-webui version 9.6 and test SVG file upload with embedded JavaScript
Check Version:
Check lollms-webui version in web interface or configuration files
Verify Fix Applied:
Verify commit 9b0f6c4ad1b9a2cd3466dcefaa278df30feed67e is applied and test SVG uploads no longer execute scripts
📡 Detection & Monitoring
Log Indicators:
- Unusual SVG file uploads
- Multiple failed upload attempts
- Requests to external domains from SVG rendering
Network Indicators:
- Unexpected redirects from lollms-webui instance
- External script loading from uploaded files
SIEM Query:
source="lollms-webui" AND (file_extension=".svg" OR url_contains("redirect"))