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 package | Versions | Reported by |
|---|---|---|
| DataDog guarddog | < 0.1.5 | CVE List |
| guarddog (PyPI) | before 0.1.5, before a56aff58264cb6b7855d71b00dc10c39a5dbd306 | GitHub Advisory Database, PyPA Advisory Database |
| datadoghq guarddog | before 0.1.5 | NVD |
All scores
| GitHub_M | 5.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L |
| GitHub | 5.8low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
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
| https://github.com/DataDog/guarddog/security/advisories/GHSA-rp2v-v467-q9vq | advisory, third-party-advisory, web | |
| https://github.com/DataDog/guarddog/pull/89/commits/a56aff58264cb6b7855d71b00dc10c39a5dbd306 | fix, patch, third-party-advisory, web | |
| https://github.com/DataDog/guarddog/releases/tag/v0.1.5 | release-notes, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-23531 | advisory | |
| https://github.com/DataDog/guarddog/pull/89 | web | |
| https://github.com/DataDog/guarddog/commit/98af5c8c1e9c15fa888c900252e76116b0ec25d1 | web | |
| https://github.com/DataDog/guarddog | package | |
| https://github.com/pypa/advisory-database/tree/main/vulns/guarddog/PYSEC-2022-42994.yaml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-23531 changed 2025-04-17 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-rp2v-v467-q9vq changed 2026-02-22 | CC-BY-4.0 |
| NVD | CVE-2022-23531 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2022-42994 changed 2026-02-22 | CC-BY-4.0 |