CVE-2024-5452
RCE via Property/Class Pollution in lightning-ai/pytorch-lightning
Also known as GHSA-cgwc-qvrx-rf7f, PYSEC-2026-385, PYSEC-2026-3974
Mitigation
- Upgrade lightning to 2.3.3 or later.
- Upgrade pytorch-lightning to 2.3.3 or later.
Who should check
- Projects that depend on PyPI package lightning (< 2.3.3)
- Projects that depend on PyPI package pytorch-lightning (< 2.3.3)
- Anyone running lightning-ai/pytorch-lightning >= unspecified, < 2.3.3
Vulnerability facts
- Affected
- lightning < 2.3.3; pytorch-lightning < 2.3.3
- Fixed in
- 2.3.3
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.8 (v3.0, CNA)CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 4.30% chance of exploitation in 30 days (percentile 92, 2026-11-26)
- CWE
- CWE-915
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI lightning | < 2.3.3 | 2.3.3 | osv |
| PyPI pytorch-lightning | < 2.3.3 | 2.3.3 | osv |
| lightning-ai/pytorch-lightning | >= unspecified, < 2.3.3 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-5452. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-5452.md Affected: lightning < 2.3.3; pytorch-lightning < 2.3.3 Fixed in: 2.3.3 Steps: 1. Search this machine and project for lightning (PyPI), pytorch-lightning (PyPI), lightning-ai/pytorch-lightning: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
Exploits and PoCs
Other
- https://github.com/Lightning-AI/pytorch-lightning/issues/20038
- https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.3.3
- https://github.com/lightning-ai/pytorch-lightning
- https://github.com/pypa/advisory-database/tree/main/vulns/lightning/PYSEC-2026-385.yaml
- https://github.com/pypa/advisory-database/tree/main/vulns/pytorch-lightning/PYSEC-2026-3974.yaml
- https://pypi.org/project/lightning
FAQ
Is CVE-2024-5452 being exploited?
There is no confirmed exploitation: CVE-2024-5452 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 4.30% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-5452?
Critical: CVSS 9.8 (v3.0, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2024-5452?
lightning < 2.3.3; pytorch-lightning < 2.3.3.
Is there a fix for CVE-2024-5452?
Yes. Fixed in 2.3.3. Upgrade lightning to 2.3.3 or later. Upgrade pytorch-lightning to 2.3.3 or later.
How do I check if I'm affected by CVE-2024-5452?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.