CVE-2022-23531: Guarddog GuardDog Vulnerable To Arbitrary File Vulnerability
LOWCVE-2022-23531 is a LOW (CVSS 5.8) guarddog vulnerable to arbitrary file vulnerability (CWE-23: Relative Path Traversal) affecting Guarddog libraries in the PyPI ecosystem. The issue involves guarddog vulnerable to arbitrary file write when scanning a specially-crafted pypi package. Remediation is available by upgrading affected packages to version 0.1.5.
CVE-2022-23531 at a Glance
Security Impact
CVSS: 5.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L).
How to Fix CVE-2022-23531
To remediate this vulnerability, upgrade all affected Guarddog dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install guarddog>=0.1.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show guarddog
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-23531, inspect your installed packages using pip:
pip show guarddog
Analyze the terminal output to locate any version of Guarddog in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.5), your application is affected.
Note: The pip show guarddog command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Guarddog, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-23531 Affected Guarddog Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
guarddog
|
PyPI |
< 0.1.5
|
0.1.5
|
References
Frequently Asked Questions
What is CVE-2022-23531?
Which Guarddog versions are affected?
What version fixes CVE-2022-23531?
Is guarddog affected?
What is the CVSS score of CVE-2022-23531?
What CWE is associated with CVE-2022-23531?
How can I check PyPI dependencies for CVE-2022-23531?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rp2v-v467-q9vq",
"modified" : "2024-11-18T16:26:28Z",
"published" : "2022-12-02T22:25:25Z",
"aliases" : [ "CVE-2022-23531" ],
"summary" : "GuardDog vulnerable to arbitrary file write when scanning a specially-crafted PyPI package",
"details" : "### Impact\n\nRunning GuardDog against a specially-crafted package can allow an attacker to write an arbitrary file on the machine where GuardDog is executed.\n\nThis 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\n\n### Remediation\n\nUpgrade to GuardDog v0.1.5 or more recent.\n\n### References\n\n* https://semgrep.dev/r?q=trailofbits.python.tarfile-extractall-traversal.tarfile-extractall-traversal\n* https://www.trellix.com/en-us/about/newsroom/stories/research/tarfile-exploiting-the-world.html\n* https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractall\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "guarddog"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.1.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/DataDog/guarddog/security/advisories/GHSA-rp2v-v467-q9vq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23531"
}, {
"type" : "WEB",
"url" : "https://github.com/DataDog/guarddog/pull/89"
}, {
"type" : "WEB",
"url" : "https://github.com/DataDog/guarddog/commit/98af5c8c1e9c15fa888c900252e76116b0ec25d1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/DataDog/guarddog"
}, {
"type" : "WEB",
"url" : "https://github.com/DataDog/guarddog/releases/tag/v0.1.5"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/guarddog/PYSEC-2022-42994.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-23" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-02T22:25:25Z",
"nvd_published_at" : "2022-12-17T00:15:00Z"
}
}