Advisory

GHSA-rp2v-v467-q9vq

Also known as: CVE-2022-23531, PYSEC-2022-42994

Summary

GuardDog vulnerable to arbitrary file write when scanning a specially-crafted PyPI package

Details

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

Severity

Low Basis: The source's own band: LOW

Dates

Published
2022-12-02 22:25 UTC
Modified
2026-02-22 22:55 UTC

Affected packages and fixes

guarddog

PyPI · All systems

Affected

  • introduced 0, fixed 0.1.5 (ecosystem)

Fixed versions

0.1.5

Fix

  • Fixed version 0.1.5
    pip install --upgrade guarddog==0.1.5

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences