CVE-2024-21542: Luigi Luigi Arbitrary File Write Vulnerability

HIGH
Advisory Identifier: GHSA-8qch-vj6m-2694
CVSS 8.6
CWE-29 CWE-22
Published
Advisory Summary

CVE-2024-21542 is a HIGH (CVSS 8.6) luigi arbitrary file write vulnerability (CWE-29: Path Traversal: '\..\filename') affecting Luigi libraries in the PyPI ecosystem. The issue involves luigi arbitrary file write via archive extraction (zip slip). Remediation is available by upgrading affected packages to version 3.6.0.

CVE-2024-21542 at a Glance

CVE Identifier CVE-2024-21542
GHSA Identifier GHSA-8qch-vj6m-2694
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-29: Path Traversal: '\..\filename'
Affected Product Luigi
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.6

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

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

How to Fix CVE-2024-21542

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

luigi fixed: 3.6.0
pip install luigi>=3.6.0
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 luigi

How to Check if You Are Affected

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

pip show luigi

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-29: Path Traversal: '\..\filename', where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory. In Luigi, 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

Versions of the package luigi before 3.6.0 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) due to improper destination file path validation in the _extract_packages_archive function.

CVE-2024-21542 Affected Luigi Versions

1 component(s)
Fixed Versions:
3.6.0
Product / Package Ecosystem Affected Versions Fixed Version
luigi
PyPI
< 3.6.0
3.6.0

References

Frequently Asked Questions

What is CVE-2024-21542?
CVE-2024-21542 is a security vulnerability in Luigi involving luigi Arbitrary File Write via Archive Extraction (Zip Slip) under CWE-29: Path Traversal: '\..\filename'.
Which Luigi versions are affected?
Affected versions include releases prior to 3.6.0 across affected packages: luigi.
What version fixes CVE-2024-21542?
Upgrading to 3.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is luigi affected?
Yes, luigi is affected in releases prior to 3.6.0. Upgrade your dependency to 3.6.0 or later.
What is the CVSS score of CVE-2024-21542?
CVE-2024-21542 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N.
What CWE is associated with CVE-2024-21542?
CVE-2024-21542 is classified under CWE-29: Path Traversal: '\..\filename' (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.).
How can I check PyPI dependencies for CVE-2024-21542?
Run the dependency tree command: 'pip show luigi'. 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-8qch-vj6m-2694",
  "modified" : "2025-02-11T00:36:39Z",
  "published" : "2024-12-10T06:31:40Z",
  "aliases" : [ "CVE-2024-21542" ],
  "summary" : "luigi Arbitrary File Write via Archive Extraction (Zip Slip)",
  "details" : "Versions of the package luigi before 3.6.0 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) due to improper destination file path validation in the _extract_packages_archive function.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:H/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "luigi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21542"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spotify/luigi/issues/3301"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spotify/luigi/commit/b5d1b965ead7d9f777a3216369b5baf23ec08999"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/luigi/PYSEC-2024-159.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spotify/luigi"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spotify/luigi/releases/tag/v3.6.0"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-PYTHON-LUIGI-7830489"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-29" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-10T17:02:23Z",
    "nvd_published_at" : "2024-12-10T05:15:07Z"
  }
}