CVE-2024-1520

9.8 CRITICAL

📋 TL;DR

This CVE describes a critical OS command injection vulnerability in the lollms-webui application's '/open_code_folder' endpoint. Attackers can execute arbitrary commands on the underlying operating system by injecting malicious input into the 'discussion_id' parameter. Any system running a vulnerable version of lollms-webui with this endpoint exposed is affected.

💻 Affected Systems

Products:
  • parisneo/lollms-webui
Versions: Versions prior to commit 2497d1a4fe5a09f003bf7a9bc426139e9295a934
Operating Systems: All operating systems where lollms-webui runs
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default configuration when the '/open_code_folder' endpoint is accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attackers to execute arbitrary commands as the web server user, potentially leading to privilege escalation, data exfiltration, or installation of persistent backdoors.

🟠

Likely Case

Unauthorized command execution leading to data leakage, service disruption, or lateral movement within the network.

🟢

If Mitigated

Limited impact if proper input validation and command sanitization are implemented, potentially reduced to denial of service or limited information disclosure.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The vulnerability is straightforward to exploit with publicly available proof-of-concept code from the huntr.com bounty.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Commit 2497d1a4fe5a09f003bf7a9bc426139e9295a934 and later

Vendor Advisory: https://github.com/parisneo/lollms-webui/commit/2497d1a4fe5a09f003bf7a9bc426139e9295a934

Restart Required: Yes

Instructions:

1. Update to the latest version of lollms-webui. 2. Pull the latest changes from the repository. 3. Restart the lollms-webui service.

🔧 Temporary Workarounds

Disable vulnerable endpoint

all

Remove or disable access to the '/open_code_folder' endpoint

Modify application configuration to restrict endpoint access

Implement input validation

all

Add strict input validation for the 'discussion_id' parameter

Implement whitelist validation for discussion_id parameter

🧯 If You Can't Patch

  • Implement network segmentation to isolate lollms-webui instances from critical systems
  • Deploy web application firewall (WAF) rules to block command injection patterns

🔍 How to Verify

Check if Vulnerable:

Check if your lollms-webui version is prior to commit 2497d1a4fe5a09f003bf7a9bc426139e9295a934

Check Version:

git log --oneline -1

Verify Fix Applied:

Verify that the application code includes the fix from commit 2497d1a4fe5a09f003bf7a9bc426139e9295a934

📡 Detection & Monitoring

Log Indicators:

  • Unusual command execution patterns in system logs
  • Multiple failed attempts to access '/open_code_folder' with suspicious parameters

Network Indicators:

  • Unexpected outbound connections from the lollms-webui server
  • Traffic patterns indicating command and control activity

SIEM Query:

source="web_server_logs" AND uri="/open_code_folder" AND (discussion_id CONTAINS "|" OR discussion_id CONTAINS ";" OR discussion_id CONTAINS "$")

🔗 References

📤 Share & Export