CVE-2024-8020: Pytorch lightning Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-98fp-7v67-4v3q
CVSS 7.5
CWE-248
Published
Advisory Summary

CVE-2024-8020 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-248: Uncaught Exception) affecting Pytorch lightning libraries in the PyPI ecosystem. The issue involves pytorch lightning denial of service vulnerability. Remediation is available in the latest vendor maintenance releases.

CVE-2024-8020 at a Glance

CVE Identifier CVE-2024-8020
GHSA Identifier GHSA-98fp-7v67-4v3q
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-248: Uncaught Exception
Affected Product Pytorch lightning
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2024-8020

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

pytorch-lightning fixed: Latest secure release
pip install pytorch-lightning>=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 pytorch-lightning

How to Check if You Are Affected

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

pip show pytorch-lightning

Analyze the terminal output to locate any version of Pytorch lightning 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 pytorch-lightning command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Pytorch lightning, 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 in lightning-ai/pytorch-lightning version 2.3.2 allows an attacker to cause a denial of service by sending an unexpected POST request to the `/api/v1/state` endpoint of `LightningApp`. This issue occurs due to improper handling of unexpected state values, which results in the server shutting down.

CVE-2024-8020 Affected Pytorch lightning Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
pytorch-lightning
PyPI
≤ 2.3.2

References

Frequently Asked Questions

What is CVE-2024-8020?
CVE-2024-8020 is a security vulnerability in Pytorch lightning involving PyTorch Lightning denial of service vulnerability under CWE-248: Uncaught Exception.
Which Pytorch lightning versions are affected?
Affected versions include releases prior to current release patches across affected packages: pytorch-lightning.
What version fixes CVE-2024-8020?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is pytorch-lightning affected?
Yes, pytorch-lightning 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-8020?
CVE-2024-8020 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-8020?
CVE-2024-8020 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check PyPI dependencies for CVE-2024-8020?
Run the dependency tree command: 'pip show pytorch-lightning'. 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-98fp-7v67-4v3q",
  "modified" : "2025-03-21T21:56:43Z",
  "published" : "2025-03-20T12:32:47Z",
  "aliases" : [ "CVE-2024-8020" ],
  "summary" : "PyTorch Lightning denial of service vulnerability",
  "details" : "A vulnerability in lightning-ai/pytorch-lightning version 2.3.2 allows an attacker to cause a denial of service by sending an unexpected POST request to the `/api/v1/state` endpoint of `LightningApp`. This issue occurs due to improper handling of unexpected state values, which results in the server shutting down.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pytorch-lightning"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-8020"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Lightning-AI/pytorch-lightning"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/8b642a78-2b80-4fb0-9b2f-8ba0ff37db6a"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-21T21:56:43Z",
    "nvd_published_at" : "2025-03-20T10:15:39Z"
  }
}