CVE-2024-6971: Lollms Path Traversal Vulnerability

LOW
Advisory Identifier: GHSA-7pgr-32fx-c6x9
CVSS 3.4
CWE-22
Published
Advisory Summary

CVE-2024-6971 is a LOW (CVSS 3.4) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Lollms libraries in the PyPI ecosystem. The issue involves lord of large language models (lollms) server path traversal vulnerability in lollms_file_system.py. Remediation is available in the latest vendor maintenance releases.

CVE-2024-6971 at a Glance

CVE Identifier CVE-2024-6971
GHSA Identifier GHSA-7pgr-32fx-c6x9
Severity LOW
CVSS v3.1 Base Score 3.4
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Lollms
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2024-6971

To remediate this vulnerability, upgrade all affected Lollms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

lollms fixed: Latest secure release
pip install lollms>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show lollms

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-6971, inspect your installed packages using pip:

pip show lollms

Analyze the terminal output to locate any version of Lollms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show lollms command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Lollms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A path traversal vulnerability exists in the ParisNeo/lollms repository, specifically in the `lollms_file_system.py` file. The functions `add_rag_database`, `toggle_mount_rag_database`, and `vectorize_folder` do not implement security measures such as `sanitize_path_from_endpoint` or `sanitize_path`. This allows an attacker to perform vectorize operations on `.sqlite` files in any directory on the victim's computer, potentially installing multiple packages and causing a crash.

CVE-2024-6971 Affected Lollms Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
lollms
PyPI
≤ 9.5.1

References

Frequently Asked Questions

What is CVE-2024-6971?
CVE-2024-6971 is a security vulnerability in Lollms involving Lord of Large Language Models (LoLLMs) Server path traversal vulnerability in lollms_file_system.py under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Lollms versions are affected?
Affected versions include releases prior to current release patches across affected packages: lollms.
What version fixes CVE-2024-6971?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is lollms affected?
Yes, lollms is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-6971?
CVE-2024-6971 has a CVSS v3.1 base score of 3.4 (LOW) with vector string CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2024-6971?
CVE-2024-6971 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2024-6971?
Run the dependency tree command: 'pip show lollms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7pgr-32fx-c6x9",
  "modified" : "2024-10-11T17:47:39Z",
  "published" : "2024-10-11T15:30:32Z",
  "aliases" : [ "CVE-2024-6971" ],
  "summary" : "Lord of Large Language Models (LoLLMs) Server path traversal vulnerability in lollms_file_system.py",
  "details" : "A path traversal vulnerability exists in the ParisNeo/lollms repository, specifically in the `lollms_file_system.py` file. The functions `add_rag_database`, `toggle_mount_rag_database`, and `vectorize_folder` do not implement security measures such as `sanitize_path_from_endpoint` or `sanitize_path`. This allows an attacker to perform vectorize operations on `.sqlite` files in any directory on the victim's computer, potentially installing multiple packages and causing a crash.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:H/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "lollms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "9.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-6971"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ParisNeo/lollms/commit/aeace796d861e922133b769710019608a6363264"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ParisNeo/lollms"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/fbfe7cd0-99fb-4305-bd07-8b573364109e"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-11T17:47:38Z",
    "nvd_published_at" : "2024-10-11T13:15:16Z"
  }
}