Security Digest · Vulnerability record

CVE-2024-5452: Remote code execution in pytorch lightning

A remote code execution (RCE) vulnerability exists in the lightning-ai/pytorch-lightning library version 2.2.1 due to improper handling of deserialized user input and mismanagement of dunder attributes by the deepdiff library.

CVSS 9.8 Critical EPSS 26.8% · p98

Should you act?

High exploit likelihood

EPSS ranks it in the top 5% of all CVEs for likely exploitation in the next 30 days. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • Not in CISA KEV, but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
  • EPSS 26.8%, percentile 98: FIRST’s model estimates a 26.8% chance of exploitation activity in the next 30 days, higher than 98% of all scored CVEs (very high). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes lightning (PyPI) < 2.3.3, fixed in 2.3.3. Check your lockfile, including transitive dependencies.

What it is

A remote code execution (RCE) vulnerability exists in the lightning-ai/pytorch-lightning library version 2.2.1 due to improper handling of deserialized user input and mismanagement of dunder attributes by the deepdiff library. The library uses deepdiff.Delta objects to modify application state based on frontend actions. However, it is possible to bypass the intended restrictions on modifying dunder attributes, allowing an attacker to construct a serialized delta that passes the deserializer whitelist and contains dunder attributes. When processed, this can be exploited to access other modules, classes, and instances, leading to arbitrary attribute write and total RCE on any self-hosted pytorch-lightning application in its default configuration, as the delta endpoint is enabled by default.

From the GitHub advisory

A remote code execution (RCE) vulnerability exists in the lightning-ai/pytorch-lightning library version 2.2.1 due to improper handling of deserialized user input and mismanagement of dunder attributes by the deepdiff library. The library uses deepdiff.Delta objects to modify application state based on frontend actions. However, it is possible to bypass the intended restrictions on modifying dunder attributes, allowing an attacker to construct a serialized delta that passes the deserializer whitelist and contains dunder attributes. When processed, this can be exploited to access other modules, classes, and instances, leading to arbitrary attribute write and total RCE on any self-hosted pytorch-lightning application in its default configuration, as the delta endpoint is enabled by default.

Weakness type: CWE-915, CWE-913.

Product: lightning (PyPI) · Assigned by: @huntr_ai · Published: 2024-06-06

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
PyPIlightning< 2.3.32.3.3
VendorProductAffected versions (per CVE record)
lightning-ailightning-ai/pytorch-lightningunspecified < 2.3.3

Severity scores

Scored byCVSSScoreVector
@huntr_ai3.09.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub3.19.8 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Privileges required: none (no login)
  • User interaction: none
  • Scope: unchanged

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation poc, automatable yes, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 26.83% probability of exploitation activity in the next 30 days; percentile 98.

Timeline

  • — CVE record published by @huntr_ai
  • — GitHub-reviewed advisory GHSA-cgwc-qvrx-rf7f published (critical)
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-cgwc-qvrx-rf7f github.com
  2. CVE.org record CVE-2024-5452 cve.org
  3. NVD entry CVE-2024-5452 nvd.nist.gov

Other references from the CVE record and advisory

  1. huntr.com huntr.com
  2. github.com github.com
  3. github.com github.com
  4. github.com github.com

Critical PyPI advisories · Today’s Security Digest