Vulnerability Details : CVE-2022-23530
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.
Vulnerability category: Directory traversal
Products affected by CVE-2022-23530
- cpe:2.3:a:datadoghq:guarddog:*:*:*:*:*:python:*:*
Exploit prediction scoring system (EPSS) score for CVE-2022-23530
0.11%
Probability of exploitation activity in the next 30 days
EPSS Score History
~ 44 %
Percentile, the proportion of vulnerabilities that are scored at or less
CVSS scores for CVE-2022-23530
Base Score | Base Severity | CVSS Vector | Exploitability Score | Impact Score | Score Source | First Seen |
---|---|---|---|---|---|---|
6.5
|
MEDIUM | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
2.8
|
3.6
|
NIST | |
5.8
|
MEDIUM | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L |
1.6
|
3.7
|
GitHub, Inc. |
CWE ids for CVE-2022-23530
-
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.Assigned by: security-advisories@github.com (Primary)
References for CVE-2022-23530
-
https://github.com/DataDog/guarddog/security/advisories/GHSA-78m5-jpmf-ch7v
Arbitrary file write when scanning a specially-crafted remote PyPI package · Advisory · DataDog/guarddog · GitHubExploit;Third Party Advisory
-
https://github.com/DataDog/guarddog/commit/37c7d0767ba28f4df46117d478f97652594c491c
Securely extract PyPI .tar.gz archives (#102) · DataDog/guarddog@37c7d07 · GitHubPatch;Third Party Advisory
-
https://github.com/DataDog/guarddog/blob/a1d064ceb09d39bb28deb6972bc0a278756ea91f/guarddog/scanners/package_scanner.py#L153..158
guarddog/package_scanner.py at a1d064ceb09d39bb28deb6972bc0a278756ea91f · DataDog/guarddog · GitHubExploit;Third Party Advisory
Jump to