CVE-2025-6773: Lightrag hku Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-v9w6-9hq9-33ch
CVSS 5.3
CWE-22
Published
Advisory Summary

CVE-2025-6773 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Lightrag hku libraries in the PyPI ecosystem. The issue involves hkuds lightrag allows path traversal via function upload_to_input_dir. Remediation is available by upgrading affected packages to version 1.3.8.

CVE-2025-6773 at a Glance

CVE Identifier CVE-2025-6773
GHSA Identifier GHSA-v9w6-9hq9-33ch
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Lightrag hku
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2025-6773

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

lightrag-hku fixed: 1.3.8
pip install lightrag-hku>=1.3.8
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 lightrag-hku

How to Check if You Are Affected

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

pip show lightrag-hku

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

Note: The pip show lightrag-hku 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 Lightrag hku, 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 vulnerability was found in HKUDS LightRAG up to 1.3.8. It has been declared as critical. Affected by this vulnerability is the function upload_to_input_dir of the file lightrag/api/routers/document_routes.py of the component File Upload. The manipulation of the argument file.filename leads to path traversal. It is possible to launch the attack on the local host. The identifier of the patch is 60777d535b719631680bcf5d0969bdef79ca4eaf. It is recommended to apply a patch to fix this issue.

CVE-2025-6773 Affected Lightrag hku Versions

1 component(s)
Fixed Versions:
1.3.8
Product / Package Ecosystem Affected Versions Fixed Version
lightrag-hku
PyPI
< 1.3.8
1.3.8

References

Frequently Asked Questions

What is CVE-2025-6773?
CVE-2025-6773 is a security vulnerability in Lightrag hku involving HKUDS LightRAG allows Path Traversal via function upload_to_input_dir under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Lightrag hku versions are affected?
Affected versions include releases prior to 1.3.8 across affected packages: lightrag-hku.
What version fixes CVE-2025-6773?
Upgrading to 1.3.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lightrag-hku affected?
Yes, lightrag-hku is affected in releases prior to 1.3.8. Upgrade your dependency to 1.3.8 or later.
What is the CVSS score of CVE-2025-6773?
CVE-2025-6773 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2025-6773?
CVE-2025-6773 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-2025-6773?
Run the dependency tree command: 'pip show lightrag-hku'. 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-v9w6-9hq9-33ch",
  "modified" : "2025-06-30T11:45:58Z",
  "published" : "2025-06-27T21:30:29Z",
  "aliases" : [ "CVE-2025-6773" ],
  "summary" : "HKUDS LightRAG allows Path Traversal via function upload_to_input_dir",
  "details" : "A vulnerability was found in HKUDS LightRAG up to 1.3.8. It has been declared as critical. Affected by this vulnerability is the function upload_to_input_dir of the file lightrag/api/routers/document_routes.py of the component File Upload. The manipulation of the argument file.filename leads to path traversal. It is possible to launch the attack on the local host. The identifier of the patch is 60777d535b719631680bcf5d0969bdef79ca4eaf. It is recommended to apply a patch to fix this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "lightrag-hku"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-6773"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/HKUDS/LightRAG/issues/1692"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/HKUDS/LightRAG/issues/1692#issuecomment-3009368235"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/HKUDS/LightRAG/commit/60777d535b719631680bcf5d0969bdef79ca4eaf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/HKUDS/LightRAG"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.314089"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.314089"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?submit.601276"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-30T11:45:58Z",
    "nvd_published_at" : "2025-06-27T19:15:31Z"
  }
}