Vulnerabilities in pkg:golang/github.com/anchore/stereoscope
PACKAGECVE-2024-24579 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/anchore/stereoscope libraries in the Go ecosystem. The issue involves stereoscope vulnerable to tar path traversal when processing oci tar archives. Remediation is available by upgrading affected packages to version 0.0.1.
pkg:golang/github.com/anchore/stereoscope
Vulnerability advisories affecting package pkg:golang/github.com/anchore/stereoscope. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-hpxr-w9w7-g4gv | CVE-2024-24579 | MODERATE | stereoscope vulnerable to tar path traversal when processing OCI tar archives |
CVE-2024-24579 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L).
How to Fix CVE-2024-24579
To remediate this vulnerability, upgrade all affected Github.com/anchore/stereoscope dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/anchore/stereoscope to 0.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/anchore/stereoscope
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-24579, inspect your project dependencies for Github.com/anchore/stereoscope:
inspect dependencies for github.com/anchore/stereoscope
Analyze the terminal output to locate any version of Github.com/anchore/stereoscope in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where 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. In Github.com/anchore/stereoscope, 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-2024-24579 Affected Github.com/anchore/stereoscope Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/anchore/stereoscope
|
Go |
< 0.0.1
|
0.0.1
|
References
Frequently Asked Questions
What is CVE-2024-24579?
Which Github.com/anchore/stereoscope versions are affected?
What version fixes CVE-2024-24579?
Is github.com/anchore/stereoscope affected?
What is the CVSS score of CVE-2024-24579?
What CWE is associated with CVE-2024-24579?
How can I check Go dependencies for CVE-2024-24579?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hpxr-w9w7-g4gv",
"modified" : "2024-01-31T22:39:17Z",
"published" : "2024-01-31T22:39:17Z",
"aliases" : [ "CVE-2024-24579" ],
"summary" : "stereoscope vulnerable to tar path traversal when processing OCI tar archives",
"details" : "### Impact\nIt is possible to craft an OCI tar archive that, when stereoscope attempts to unarchive the contents, will result in writing to paths outside of the unarchive temporary directory. Specifically, use of `github.com/anchore/stereoscope/pkg/file.UntarToDirectory()` function, the `github.com/anchore/stereoscope/pkg/image/oci.TarballImageProvider` struct, or the higher level `github.com/anchore/stereoscope/pkg/image.Image.Read()` function express this vulnerability.\n\n### Patches\nPatched in v0.0.1\n\n### Workarounds\nIf you are using the OCI archive as input into stereoscope then you can switch to using an [OCI layout](https://github.com/opencontainers/image-spec/blob/main/image-layout.md) by unarchiving the tar archive and provide the unarchived directory to stereoscope.\n\n### References\n- Patch PR https://github.com/anchore/stereoscope/pull/214",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/anchore/stereoscope"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/anchore/stereoscope/security/advisories/GHSA-hpxr-w9w7-g4gv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24579"
}, {
"type" : "WEB",
"url" : "https://github.com/anchore/stereoscope/commit/09dacab4d9ee65ee8bc7af8ebf4aa7b5aaa36204"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/anchore/stereoscope"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-31T22:39:17Z",
"nvd_published_at" : "2024-01-31T17:15:40Z"
}
}