CVE-2022-23531
JSON

5.8medium

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

Severity
5.8medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.74% (higher than 55% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-rp2v-v467-q9vqPYSEC-2022-42994

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.

Affected

Product or packageVersionsReported by
DataDog guarddog< 0.1.5CVE List
guarddog (PyPI)before 0.1.5, before a56aff58264cb6b7855d71b00dc10c39a5dbd306GitHub Advisory Database, PyPA Advisory Database
datadoghq guarddogbefore 0.1.5NVD

All scores

GitHub_M5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L
GitHub5.8low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-22CWE-23

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

Running GuardDog against a specially-crafted package can allow an attacker to write an arbitrary file on the machine where GuardDog is executed.

This is 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. See also https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractall

Remediation

Upgrade to GuardDog v0.1.5 or more recent.

References
NVD (es)

GuardDog es una herramienta CLI para identificar paquetes PyPI maliciosos. Las versiones anteriores a la 0.1.5 son vulnerables a path traversal relativo cuando se escanea un paquete PyPI local especialmente manipulado. Ejecutar GuardDog contra un paquete especialmente manipulado puede permitir a un atacante escribir un archivo arbitrario en la máquina donde se ejecuta GuardDog debido a una vulnerabilidad de path traversal al extraer el archivo .tar.gz del paquete que se está analizando, que existe por diseño en el función tarfile.TarFile.extractall. Este problema está solucionado en la versión 0.1.5.

References

Sources

SourceRecordLicence
CVE ListCVE-2022-23531 changed 2025-04-17CVE Terms of Use
GitHub Advisory DatabaseGHSA-rp2v-v467-q9vq changed 2026-02-22CC-BY-4.0
NVDCVE-2022-23531 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2022-42994 changed 2026-02-22CC-BY-4.0