CVE-2022-23531: Arbitrary file write when scanning a specially-crafted local PyPI package
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
Remediation
Event History
Frequently Asked Questions
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.
What is the severity of CVE-2022-23531?
CVE-2022-23531 has a severity rating of 7.8, which is considered high.
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.
How can I fix CVE-2022-23531?
To fix CVE-2022-23531, you should update GuardDog to version 0.1.5 or newer.
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.