CVE-2021-4118 Deserialization of Untrusted Data in pytorchlightning/pytorch-lightning

High 7.8 Published Updated

Attackers can execute arbitrary code by exploiting unsafe deserialization in the PyTorch Lightning library.

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-2021-4118?

CVE-2021-4118 is a high-severity unsafe deserialization vulnerability in pytorchlightning/pytorch-lightning, published on 23 Dec 2021. 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

pytorch-lightning is vulnerable to Deserialization of Untrusted Data

Weakness: CWE-502

Which versions are affected by CVE-2021-4118?

4 open source packages ship an affected version, including pytorch-lightning and lightning. It affects 1 product.

PackageAffectedFixed in
pytorch-lightning PyPIAll versions1.6.0
pytorch-lightning PyPIAll versions1.6.0
pytorch-lightning PyPIAll versions1.6.0
lightning PyPIAll versions1.6.0

Products include Lightningai Pytorch Lightning.

How do I fix CVE-2021-4118?

Upgrade pytorch-lightning to 1.6.0 or later.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2021-4118 being exploited?

There is no known exploitation of CVE-2021-4118 in the wild and no public exploit code.

Sources

Also known as GHSA-2vj5-px25-gjrp, PYSEC-2021-874, PYSEC-2026-3968.

Is CVE-2021-4118 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free