CVE-2020-29529: Github.com/hashicorp/go slug Unsafe Tar Unpacking Vulnerability
HIGHCVE-2020-29529 is a HIGH (CVSS 7.5) unsafe tar unpacking vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Github.com/hashicorp/go slug libraries in the Go ecosystem. The issue involves unsafe tar unpacking in hashicorp go-slug. Remediation is available by upgrading affected packages to version 0.5.0.
CVE-2020-29529 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2020-29529
To remediate this vulnerability, upgrade all affected Github.com/hashicorp/go slug 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/hashicorp/go-slug to 0.5.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/hashicorp/go-slug
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-29529, inspect your project dependencies for Github.com/hashicorp/go slug:
inspect dependencies for github.com/hashicorp/go-slug
Analyze the terminal output to locate any version of Github.com/hashicorp/go slug in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.0), 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-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Github.com/hashicorp/go slug, 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-2020-29529 Affected Github.com/hashicorp/go slug Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/hashicorp/go-slug
|
Go |
< 0.5.0
|
0.5.0
|
References
Frequently Asked Questions
What is CVE-2020-29529?
Which Github.com/hashicorp/go slug versions are affected?
What version fixes CVE-2020-29529?
Is github.com/hashicorp/go-slug affected?
What is the CVSS score of CVE-2020-29529?
What CWE is associated with CVE-2020-29529?
How can I check Go dependencies for CVE-2020-29529?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2g5j-5x95-r6hr",
"modified" : "2023-02-06T23:16:16Z",
"published" : "2023-02-06T23:16:16Z",
"aliases" : [ "CVE-2020-29529" ],
"summary" : "Unsafe tar unpacking in HashiCorp go-slug",
"details" : "HashiCorp go-slug before 0.5.0 does not address attempts at directory traversal involving ../ and symlinks.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/hashicorp/go-slug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-29529"
}, {
"type" : "WEB",
"url" : "https://github.com/hashicorp/go-slug/pull/12"
}, {
"type" : "WEB",
"url" : "https://github.com/hashicorp/go-slug/commit/28cafc59c8da6126a3ae94dfa84181df4073454f"
}, {
"type" : "WEB",
"url" : "https://github.com/hashicorp/go-slug/commit/764785bc4cbb9e600ad1cf1a6bd21b535c182983"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/hashicorp/go-slug"
}, {
"type" : "WEB",
"url" : "https://github.com/hashicorp/go-slug/compare/v0.4.3...v0.5.0"
}, {
"type" : "WEB",
"url" : "https://github.com/hashicorp/go-slug/releases/tag/v0.5.0"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2021-0094"
}, {
"type" : "ADVISORY",
"url" : "https://securitylab.github.com/advisories/GHSL-2020-262-zipslip-go-slug"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-59" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-02-06T23:16:16Z",
"nvd_published_at" : null
}
}