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

Published Dec 2, 2022
·
Updated

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

https://semgrep.dev/r?q=trailofbits.python.tarfile-extractall-traversal.tarfile-extractall-traversal https://www.trellix.com/en-us/about/newsroom/stories/research/tarfile-exploiting-the-world.html https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractall

Other sources

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 Software

2 affected componentsFixes available
pip/guarddog<0.1.5
0.1.5
datadoghq Guarddog Python<0.1.5

Event History

Dec 2, 2022
Advisory Published
via GitHub·10:25 PM
Dec 16, 2022
CVE Published
via MITRE·11:41 PM
Data Sourced
via MITRE·11:41 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-23531?

CVE-2022-23531 is a vulnerability in the GuardDog CLI tool that allows an attacker to write an arbitrary file on the machine when scanning a specially-crafted local PyPI package.

2

What is the severity of CVE-2022-23531?

CVE-2022-23531 has a severity rating of 7.8, which is considered high.

3

How does CVE-2022-23531 affect GuardDog?

CVE-2022-23531 affects GuardDog versions prior to 0.1.5, allowing for Relative Path Traversal when scanning a specially-crafted local PyPI package.

4

How can I fix CVE-2022-23531?

To fix CVE-2022-23531, you should update GuardDog to version 0.1.5 or newer.

5

Where can I find more information about CVE-2022-23531?

More information about CVE-2022-23531 can be found in the GitHub repository and security advisories for GuardDog.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203