{"id":"CVE-2022-23530","published":"2022-12-16T22:56:33Z","modified":"2025-04-17T14:34:26Z","title":"GuardDog vulnerable to arbitrary file write when scanning a specially-crafted remote PyPI package","vendor":"DataDog","product":"guarddog","tier":"tail","description":{"text":"GuardDog is a CLI tool to identify malicious PyPI packages. Versions prior to v0.1.8 are vulnerable to arbitrary file write when scanning a specially-crafted remote PyPI package. Extracting files using shutil.unpack_archive() from a potentially malicious tarball without validating that the destination file path is within the intended destination directory can cause files outside the destination directory to be overwritten.  This issue is patched in version 0.1.8. Potential workarounds include using a safer module, like zipfile, and validating the location of the extracted files and discarding those with malicious paths.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.8,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00778,"percentile":0.56779,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/DataDog/guarddog/security/advisories/GHSA-78m5-jpmf-ch7v","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/DataDog/guarddog/commit/37c7d0767ba28f4df46117d478f97652594c491c","tags":["x_refsource_MISC"]},{"url":"https://github.com/DataDog/guarddog/blob/a1d064ceb09d39bb28deb6972bc0a278756ea91f/guarddog/scanners/package_scanner.py#L153..158","tags":["x_refsource_MISC"]}],"priority":{"score":15.4,"factors":[{"name":"EPSS percentile","points":11.36},{"name":"CVSS severity","points":4.06}]},"vendorSlug":"datadog","affectedVersions":[{"vendor":"DataDog","product":"guarddog","versions":["< 0.1.8"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-17T14:34:18.663488Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"guarddog","vulnerableRanges":["<0.1.8"],"patched":["0.1.8"],"from":["GHSA-78m5-jpmf-ch7v","PYSEC-2022-42993"],"provenance":"source"}],"summary":{"text":"The flaw is a path traversal weakness in DataDog's GuardDog, a CLI tool for identifying malicious PyPI packages, in versions prior to v0.1.8, where files extracted with shutil.unpack_archive() from a remote PyPI package are not checked to confirm their destination stays within the intended directory. An attacker can craft a malicious package archive that, when scanned remotely with GuardDog, overwrites files outside the destination directory, and exploitation requires a user to initiate the scan of that package.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:33:20Z"},"euvd":{"id":"EUVD-2022-0117","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-datadog-guarddog-cve-2022-23530","parents":[{"from":"CVE-2022-23531","to":"CVE-2022-23530","relation":"successor","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:guarddog","fromFixed":"0.1.5","toFixed":"0.1.8","daysApart":0},{"kind":"same-code","provenance":"machine","files":["guarddog/scanners/package_scanner.py"],"commits":["https://github.com/DataDog/guarddog/commit/37c7d0767ba28f4df46117d478f97652594c491c","https://github.com/DataDog/guarddog/commit/a56aff58264cb6b7855d71b00dc10c39a5dbd306","https://github.com/DataDog/guarddog/commit/98af5c8c1e9c15fa888c900252e76116b0ec25d1"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2022-23531","published":"2022-12-16","fixed":"0.1.5","kev":false},{"cve":"CVE-2022-23530","published":"2022-12-16","fixed":"0.1.8","kev":false},{"cve":"CVE-2026-22870","published":"2026-01-13","fixed":"2.7.1","kev":false},{"cve":"CVE-2026-22871","published":"2026-01-13","fixed":"2.7.1","kev":false}],"package":"PyPI:guarddog"}}