CVE-2024-1873 Overview
parisneo/lollms-webui is vulnerable to path traversal and denial of service attacks due to an exposed /select_database endpoint in version a9d16b0. The endpoint improperly handles file paths, allowing attackers to specify absolute paths when interacting with the DiscussionsDB instance. This flaw enables attackers to create directories anywhere on the system where the application has permissions, potentially leading to denial of service by creating directories with names of critical files, such as HTTPS certificate files, causing server startup failures. Additionally, attackers can manipulate the database path, resulting in the loss of client data by constantly changing the file location to an attacker-controlled location, scattering the data across the filesystem and making recovery difficult.
Critical Impact
Unauthenticated remote attackers can exploit this path traversal vulnerability to create arbitrary directories on the system, disrupt server operations by overwriting critical files, and cause permanent data loss through database path manipulation.
Affected Products
- lollms lollms_web_ui (version a9d16b0 and potentially other versions)
Discovery Timeline
- 2024-06-06 - CVE CVE-2024-1873 published to NVD
- 2025-10-15 - Last updated in NVD database
Technical Details for CVE-2024-1873
Vulnerability Analysis
This vulnerability affects the /select_database endpoint in lollms-webui, a web-based interface for large language models. The core issue stems from improper input validation when handling database path parameters. When a user interacts with the DiscussionsDB instance through this endpoint, the application fails to properly sanitize or validate the supplied file path, allowing attackers to provide absolute paths that traverse outside the intended directory structure.
The vulnerability is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), commonly known as Path Traversal. This weakness enables two distinct attack scenarios: first, attackers can create directories at arbitrary filesystem locations where the application has write permissions; second, they can manipulate the database storage location, effectively scattering user data across the filesystem.
Root Cause
The root cause of this vulnerability is the lack of proper input validation and path canonicalization in the /select_database endpoint. The application accepts user-supplied file paths without verifying that they remain within the expected application directories. Specifically, the endpoint does not:
- Validate that the supplied path is relative rather than absolute
- Normalize paths to prevent directory traversal sequences
- Restrict database operations to a predetermined safe directory
This allows malicious input to escape the intended directory boundaries and interact with sensitive areas of the filesystem.
Attack Vector
The attack is network-accessible and requires no authentication or user interaction. An attacker can remotely send crafted HTTP requests to the /select_database endpoint with malicious path parameters. The exploitation can follow two primary attack patterns:
Denial of Service Attack: An attacker can specify absolute paths pointing to critical system files, such as HTTPS certificate files or configuration files. When the application attempts to create a database directory at these locations, it can overwrite or interfere with these critical files, causing server startup failures or service disruption.
Data Loss Attack: By repeatedly changing the database path to attacker-controlled locations scattered across the filesystem, an attacker can cause client discussion data to be stored in unpredictable locations. This makes data recovery extremely difficult and effectively results in permanent data loss for legitimate users.
The vulnerability can be exploited by sending malicious requests to the exposed endpoint with path parameters such as /etc/ssl/certs/ or other critical system directories. For detailed technical information, refer to the Huntr Bounty Details.
Detection Methods for CVE-2024-1873
Indicators of Compromise
- Unexpected directories appearing in system-critical locations such as /etc/ssl/, /var/www/, or application certificate directories
- Multiple scattered database files across the filesystem outside the normal lollms-webui data directory
- Server startup failures related to certificate file corruption or missing configuration files
- Unusual HTTP requests to the /select_database endpoint containing absolute paths or path traversal sequences
Detection Strategies
- Monitor HTTP access logs for requests to /select_database containing suspicious path patterns such as ../, absolute paths starting with /, or references to system directories
- Implement file integrity monitoring on critical system directories to detect unauthorized directory creation
- Deploy web application firewall (WAF) rules to block requests containing path traversal patterns targeting the /select_database endpoint
- Configure application-level logging to capture all database path change operations for forensic analysis
Monitoring Recommendations
- Enable verbose logging for the lollms-webui application to capture all /select_database endpoint interactions
- Set up alerts for filesystem changes in directories outside the expected application data paths
- Monitor for repeated or rapid changes to database paths which may indicate an ongoing data scattering attack
- Implement network traffic analysis to detect anomalous patterns of requests to the vulnerable endpoint
How to Mitigate CVE-2024-1873
Immediate Actions Required
- Update lollms-webui to the patched version that includes commit 02e829b5653a1aa5dbbe9413ec84f96caa1274e8
- If immediate patching is not possible, restrict network access to the /select_database endpoint using firewall rules or reverse proxy configurations
- Implement authentication requirements for all administrative endpoints including /select_database
- Review filesystem permissions to minimize the directories where the application can write
Patch Information
The vulnerability has been addressed by the maintainers. The fix is available in the GitHub commit 02e829b5653a1aa5dbbe9413ec84f96caa1274e8. Users should update their lollms-webui installation to include this commit or any subsequent release that incorporates this fix.
Workarounds
- Block external access to the /select_database endpoint at the network level using firewall rules or a reverse proxy
- Run the lollms-webui application with minimal filesystem permissions, restricting write access to only necessary directories
- Deploy the application in a containerized environment with volume mounts limited to specific data directories
- Implement a web application firewall rule to reject requests containing path traversal patterns such as ../ or absolute path prefixes
# Example nginx configuration to block access to vulnerable endpoint
location /select_database {
# Block external access to vulnerable endpoint
allow 127.0.0.1;
deny all;
return 403;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

