lightning-ai/pytorch-lightning: Improper Control of Dynamically-Managed Code Resources
CVE-2024-5452 is a critical-severity improper control of dynamically-managed code resources vulnerability in lightning-ai/pytorch-lightning from Lightning-ai, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 2.3.3 as the first without the flaw, so updating lightning-ai/pytorch-lightning to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 26.8% chance of exploitation within 30 days, which is in the top 1.94% of all scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update lightning-ai/pytorch-lightning to 2.3.3 or a later version.
- Update Pytorch Lightning to 2.3.3 or a later version.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Lightning-ai | lightning-ai/pytorch-lightning | before 2.3.3; 2.2.1 and earlier | 2.3.3 |
| Lightningai | Pytorch Lightning | before 2.3.3 | 2.3.3 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.8 | Critical | NVD |
| CVSS 3.0 | 9.8 | Critical | CNA (huntr.dev) |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Control of Dynamically-Managed Code Resources
The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.
How developers prevent this class of flaw
- For any externally-influenced input, check the input against an allowlist of acceptable values.
- Refactor the code so that it does not need to be dynamically managed.
More Improper Control of Dynamically-Managed Code Resources vulnerabilities (CWE-913)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
Technical write-ups (may include proof of concept)
- huntr.com/bounties/486add92-275e-4a7b-92f9-42d84bc759daExploit, Third Party Advisory
Other vulnerabilities in lightning-ai/pytorch-lightning
- 7.5 High severity
- 9.1 Critical severity
- 9.8 Critical severity
Recent Improper Control of Dynamically-Managed Code Resources vulnerabilities
- 9.8 Critical severity
- 7.8 High severity
- 9.9 Critical severity
- 7.5 High severity
- 10.0 Critical severity
- 9.8 Critical severity
Spotted an error? Tell us.