Skip to main content
CVE Vulnerability Database

CVE-2024-6281: Lollms Path Traversal Vulnerability

CVE-2024-6281 is a path traversal flaw in parisneo/lollms that lets attackers manipulate file paths to write to critical system folders. This post covers the technical details, affected versions, security impact, and mitigation.

Published:

CVE-2024-6281 Overview

CVE-2024-6281 is a path traversal vulnerability [CWE-22] in the apply_settings function of parisneo/lollms versions prior to 9.5.1. The sanitize_path function fails to adequately validate the discussion_db_name parameter. Attackers can manipulate the parameter to escape intended directory boundaries and write files to sensitive system folders.

The flaw affects lollms, an open-source large language model interface. Successful exploitation can compromise host integrity and availability by allowing arbitrary file writes outside the application's working directory.

Critical Impact

Local attackers can write to important system folders by supplying a crafted discussion_db_name value, leading to potential integrity loss and denial of service on the host running lollms.

Affected Products

  • parisneo/lollms versions prior to 9.5.1
  • The apply_settings API endpoint that consumes discussion_db_name
  • Deployments relying on the vulnerable sanitize_path helper

Discovery Timeline

  • 2024-07-20 - CVE-2024-6281 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-6281

Vulnerability Analysis

The apply_settings function accepts a user-controlled discussion_db_name parameter that determines where the discussion database is created or opened. The application passes this value through sanitize_path, which is intended to prevent directory traversal sequences. The sanitization logic does not fully normalize or restrict traversal characters, so crafted inputs bypass the check.

An attacker who reaches the apply_settings endpoint can supply a value containing traversal sequences or absolute path fragments. The application then resolves the path outside the intended discussions directory. Because lollms writes database files at that location, the attacker gains a primitive for arbitrary file write.

The attack vector is local, and the attacker requires no authentication or user interaction based on the CVSS metrics. The vulnerability primarily impacts availability, with secondary confidentiality and integrity effects when writes overwrite critical files.

Root Cause

The root cause is inadequate input validation in sanitize_path. The function does not canonicalize the resulting path or enforce that the final destination remains within an allowlisted base directory. This is a classic [CWE-22] Improper Limitation of a Pathname to a Restricted Directory weakness.

Attack Vector

An attacker with local access to the lollms interface submits a settings update that includes a malicious discussion_db_name payload. The payload contains parent-directory references or platform-specific separators that escape the discussions folder. The application writes the resulting database file to the attacker-chosen path, potentially overwriting configuration files, service binaries, or scheduled task definitions.

Refer to the Huntr Security Bounty report for the disclosure details and the GitHub commit for the sanitization fix.

Detection Methods for CVE-2024-6281

Indicators of Compromise

  • Unexpected database or file writes outside the lollms discussions directory
  • HTTP requests to the apply_settings endpoint containing ../, ..\, or absolute paths in the discussion_db_name field
  • New or modified files in system directories with timestamps aligned to lollms process activity
  • lollms process writes to paths that do not match its documented working directory

Detection Strategies

  • Inspect application and reverse proxy logs for apply_settings requests carrying traversal characters in JSON payloads
  • Audit filesystem changes attributable to the lollms service account outside its designated data directory
  • Compare installed lollms version against 9.5.1; any lower version is vulnerable and worth flagging for review

Monitoring Recommendations

  • Enable file integrity monitoring on system directories writable by the account running lollms
  • Forward lollms application logs to a centralized logging or SIEM platform for correlation and alerting
  • Alert on process-to-path anomalies when the lollms interpreter writes outside its expected data root

How to Mitigate CVE-2024-6281

Immediate Actions Required

  • Upgrade parisneo/lollms to version 9.5.1 or later, which contains the patched sanitize_path logic
  • Restrict access to the lollms web interface to trusted local users using network segmentation and host firewall rules
  • Run the lollms service under a low-privilege account that cannot write to system directories

Patch Information

The fix is delivered in the upstream commit 26a3ff35acf152b49e1087d5698ad4864c7b6092, which hardens path handling for the discussion_db_name parameter. Upgrading to 9.5.1 or later is the authoritative remediation. Verify the installed version after upgrade and review any custom forks that may not yet include the fix.

Workarounds

  • Block or filter requests to the apply_settings endpoint that contain traversal sequences such as ../ or ..\ in JSON fields
  • Deploy lollms inside a container or sandbox with read-only mounts for host system directories to contain arbitrary writes
  • Restrict the lollms process with mandatory access controls such as AppArmor or SELinux to enforce a directory allowlist

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.