CVE-2022-23531 Arbitrary file write when scanning a specially-crafted local PyPI package

Medium 5.8 Published Updated

Attackers can write arbitrary files on the host by tricking users into scanning a malicious PyPI package with GuardDog.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-23531?

CVE-2022-23531 is a medium-severity path traversal vulnerability in DataDog guarddog, published on 16 Dec 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

GuardDog is a CLI tool to identify malicious PyPI packages. Versions prior to 0.1.5 are vulnerable to Relative Path Traversal when scanning a specially-crafted local PyPI package. Running GuardDog against a specially-crafted package can allow an attacker to write an arbitrary file on the machine where GuardDog is executed due to a path traversal vulnerability when extracting the .tar.gz file of the package being scanned, which exists by design in the tarfile.TarFile.extractall function. This issue is patched in version 0.1.5.

Weakness: CWE-22, CWE-23

Which versions are affected by CVE-2022-23531?

3 open source packages ship an affected version, including guarddog. It affects 1 product.

PackageAffectedFixed in
guarddog PyPIAll versions0.1.5
guarddog PyPIAll versions0.1.5
guarddog PyPIAll versions0.1.5

Products include Datadoghq Guarddog.

How do I fix CVE-2022-23531?

Upgrade guarddog to 0.1.5 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2022-23531 being exploited?

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

Sources

Also known as GHSA-rp2v-v467-q9vq, PYSEC-2022-42994.

Is CVE-2022-23531 in your software?

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

Check your SBOMs for free