---
id: "CVE-2024-5452"
page: "https://infrastack.ai/live/CVE-2024-5452"
kind: "vulnerability"
aliases: ["CVE-2024-5452", "GHSA-cgwc-qvrx-rf7f"]
title: "Remote code execution in pytorch lightning"
severity: "critical"
cvss: 9.8
epss: 0.26831
exploited: false
status: "open"
category: "package"
products: [{"name": "lightning", "fixed": ["2.3.3"], "affected": "< 2.3.3", "ecosystem": "pypi"}, {"name": "pytorch-lightning", "fixed": ["2.3.3"], "affected": "< 2.3.3", "ecosystem": "pypi"}, {"name": "lightningai pytorch lightning", "fixed": ["2.3.3"], "affected": "< 2.3.3", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["cwe-913", "cwe-915", "deepdiff", "package", "python", "pytorch-lightning", "self-hosted"]
not_affected_if: ["delta-endpoint-disabled", "offline-training-only"]
published_at: "2024-06-06T18:15:20+00:00"
first_seen_at: "2026-11-16T15:17:21+00:00"
updated_at: "2026-11-16T15:37:59+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-cgwc-qvrx-rf7f", "first_seen_at": "2026-11-16T15:17:21+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-5452", "first_seen_at": "2026-11-16T15:37:59+00:00"}]
exploit_sources: [{"type": "poc", "url": "https://huntr.com/bounties/486add92-275e-4a7b-92f9-42d84bc759da"}, {"type": "epss", "score": 0.26831, "url": "https://api.first.org/data/v1/epss?cve=CVE-2024-5452"}]
---

# Remote code execution in pytorch lightning

Link for people: https://infrastack.ai/live/CVE-2024-5452 (this .md is for agents)

PyTorch Lightning deserializes user-supplied deepdiff Delta objects sent to a frontend endpoint, and dunder attributes can slip past its whitelist. A remote attacker can write arbitrary attributes and execute code on the server.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:lightning affected < 2.3.3 fixed 2.3.3
- pypi:pytorch-lightning affected < 2.3.3 fixed 2.3.3
- vendor:lightningai pytorch lightning affected < 2.3.3 fixed 2.3.3

## How to check

- Run `pip show lightning pytorch-lightning` and compare the version against `2.3.3`
- Look for a self-hosted Lightning app that exposes the delta endpoint, which is enabled by default

## Fix

- `lightning` and `pytorch-lightning`: upgrade to `2.3.3`

## Timeline

- 2026-11-16T15:17:21+00:00 ghsa https://github.com/advisories/GHSA-cgwc-qvrx-rf7f
- 2026-11-16T15:37:59+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-5452

## Documents

- [fix] Patch: github.com https://github.com/lightning-ai/pytorch-lightning/commit/330af381de88cff17515418a341cbc1f9f127f9a
- [fix] Release: github.com https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.3.3
- [poc] Exploit: huntr.com https://huntr.com/bounties/486add92-275e-4a7b-92f9-42d84bc759da

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
