CVE-2024-4326
📋 TL;DR
This vulnerability allows remote attackers to execute arbitrary code on systems running vulnerable versions of parisneo/lollms-webui. Attackers can bypass security controls by manipulating settings to disable code validation, then execute malicious commands. All users running versions up to 9.3 are affected.
💻 Affected Systems
- parisneo/lollms-webui
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise with attacker gaining full control over the host, potentially leading to data theft, ransomware deployment, or lateral movement within the network.
Likely Case
Remote code execution leading to installation of backdoors, cryptocurrency miners, or data exfiltration from the compromised system.
If Mitigated
Limited impact with proper network segmentation and access controls, potentially only affecting the lollms-webui application container.
🎯 Exploit Status
Exploit requires two-step process: first bypass protections via /apply_settings, then execute code via /execute_code endpoint.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 9.5
Vendor Advisory: https://github.com/parisneo/lollms-webui/commit/abb4c6d495a95a3ef5b114ffc57f85cd650b905e
Restart Required: Yes
Instructions:
1. Stop the lollms-webui service. 2. Update to version 9.5 or later using pip or git. 3. Restart the service.
🔧 Temporary Workarounds
Network Access Restriction
linuxRestrict access to lollms-webui endpoints to trusted IP addresses only
iptables -A INPUT -p tcp --dport [lollms-port] -s [trusted-ip] -j ACCEPT
iptables -A INPUT -p tcp --dport [lollms-port] -j DROP
Endpoint Disablement
allDisable or block access to vulnerable endpoints via reverse proxy or firewall
# In nginx: location ~ ^/(apply_settings|execute_code) { deny all; }
🧯 If You Can't Patch
- Immediately restrict network access to the lollms-webui instance using firewall rules
- Monitor logs for suspicious activity on /apply_settings and /execute_code endpoints
🔍 How to Verify
Check if Vulnerable:
Check if version is 9.3 or earlier and endpoints are accessible
Check Version:
python -c "import lollms; print(lollms.__version__)" or check package metadata
Verify Fix Applied:
Confirm version is 9.5 or later and test that code execution protections are enforced
📡 Detection & Monitoring
Log Indicators:
- Unusual requests to /apply_settings endpoint with localhost parameter
- Code execution attempts via /execute_code endpoint
- Multiple rapid configuration changes
Network Indicators:
- POST requests to /apply_settings followed by /execute_code
- Unusual outbound connections from lollms-webui host
SIEM Query:
source="lollms-webui" AND (uri_path="/apply_settings" OR uri_path="/execute_code")
🔗 References
- https://github.com/parisneo/lollms-webui/commit/abb4c6d495a95a3ef5b114ffc57f85cd650b905e
- https://huntr.com/bounties/2ab9f03d-0538-4317-be21-0748a079cbdd
- https://github.com/parisneo/lollms-webui/commit/abb4c6d495a95a3ef5b114ffc57f85cd650b905e
- https://huntr.com/bounties/2ab9f03d-0538-4317-be21-0748a079cbdd