CVE-2022-0845 Code Injection in pytorchlightning/pytorch-lightning
Attackers can execute arbitrary code via injection in PyTorch Lightning, requiring an upgrade to the latest version.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-0845?
CVE-2022-0845 is a high-severity code injection vulnerability in pytorchlightning/pytorch-lightning, published on 5 Mar 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Code Injection in GitHub repository pytorchlightning/pytorch-lightning prior to 1.6.0.
Weakness: CWE-94
Which versions are affected by CVE-2022-0845?
4 open source packages ship an affected version, including pytorch-lightning and lightning. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pytorch-lightning PyPI | All versions | 1.6.0 |
pytorch-lightning PyPI | All versions | 1.6.0 |
pytorch-lightning PyPI | All versions | 1.6.0 |
lightning PyPI | All versions | 1.6.0 |
Products include Lightningai Pytorch Lightning.
How do I fix CVE-2022-0845?
Upgrade pytorch-lightning to 1.6.0 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2022-0845 being exploited?
There is no known exploitation of CVE-2022-0845 in the wild and no public exploit code.
Other vulnerabilities in pytorchlightning/pytorch-lightning
- CVE-2024-5452 RCE via Property/Class Pollution in lightning-ai/pytorch-lightning
- CVE-2026-44484 Compromise of PyTorch Lightning PyPi Package Versions
- CVE-2024-8019 Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning
- CVE-2024-5980 Arbitrary File Write via /v1/runs API endpoint in lightning-ai/pytorch-lightning
- CVE-2026-31221 PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization
Sources
Also known as GHSA-r5qj-cvf9-p85h, PYSEC-2022-181, PYSEC-2026-3969.