Vulnerabilities in pkg:golang/github.com/hashicorp/go-slug

PACKAGE
Advisory Identifier: GHSA-wpfp-cm49-9m9q
Advisory Summary

CVE-2025-0377 is a HIGH (CVSS 7.5) hashicorp go-slug vulnerable to zip 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 hashicorp go-slug vulnerable to zip slip attack. Remediation is available by upgrading affected packages to version 0.16.3.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/hashicorp/go-slug

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/hashicorp/go-slug. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-wpfp-cm49-9m9q CVE-2025-0377 HIGH HashiCorp go-slug Vulnerable to Zip Slip Attack
GHSA-2g5j-5x95-r6hr CVE-2020-29529 HIGH Unsafe tar unpacking in HashiCorp go-slug

CVE-2025-0377 at a Glance

CVE Identifier CVE-2025-0377
GHSA Identifier GHSA-wpfp-cm49-9m9q
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product Github.com/hashicorp/go slug
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2025-0377

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.

github.com/hashicorp/go-slug fixed: 0.16.3
Upgrade github.com/hashicorp/go-slug to 0.16.3
Verify Direct and Transitive Dependencies

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-2025-0377, 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.16.3), 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

## Summary HashiCorp’s go-slug library is vulnerable to a zip-slip style attack when a non-existing user-provided path is extracted from the tar entry. This vulnerability, identified as CVE-2025-0377, is fixed in go-slug 0.16.3. ## Background HashiCorp’s go-slug shared library offers functions for packing and unpacking Terraform Enterprise compatible slugs. Slugs are gzip compressed tar files containing Terraform configuration files. ## Details When go-slug performs an extraction, the filename/extraction path is taken from the tar entry via the header.Name. It was discovered that the unpacking step improperly validated paths, potentially leading to path traversal, allowing an attacker to write an arbitrary file during extraction. ## Remediation Consumers of the go-slug shared library should evaluate the risk associated with this issue in the context of their go-slug usage and upgrade go-slug to 0.16.3 or later.

CVE-2025-0377 Affected Github.com/hashicorp/go slug Versions

1 component(s)
Fixed Versions:
0.16.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/hashicorp/go-slug
Go
< 0.16.3
0.16.3

References

Frequently Asked Questions

What is CVE-2025-0377?
CVE-2025-0377 is a security vulnerability in Github.com/hashicorp/go slug involving HashiCorp go-slug Vulnerable to Zip Slip Attack under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Github.com/hashicorp/go slug versions are affected?
Affected versions include releases prior to 0.16.3 across affected packages: github.com/hashicorp/go-slug.
What version fixes CVE-2025-0377?
Upgrading to 0.16.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/hashicorp/go-slug affected?
Yes, github.com/hashicorp/go-slug is affected in releases prior to 0.16.3. Upgrade your dependency to 0.16.3 or later.
What is the CVSS score of CVE-2025-0377?
CVE-2025-0377 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2025-0377?
CVE-2025-0377 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (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.).
How can I check Go dependencies for CVE-2025-0377?
Run the dependency tree command: 'inspect dependencies for github.com/hashicorp/go-slug'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wpfp-cm49-9m9q",
  "modified" : "2025-12-17T00:26:23Z",
  "published" : "2025-01-21T18:31:07Z",
  "aliases" : [ "CVE-2025-0377" ],
  "summary" : "HashiCorp go-slug Vulnerable to Zip Slip Attack",
  "details" : "## Summary\nHashiCorp’s go-slug library is vulnerable to a zip-slip style attack when a non-existing user-provided path is extracted from the tar entry. This vulnerability, identified as CVE-2025-0377, is fixed in go-slug 0.16.3.\n\n## Background\nHashiCorp’s go-slug shared library offers functions for packing and unpacking Terraform Enterprise compatible slugs. Slugs are gzip compressed tar files containing Terraform configuration files.\n\n## Details\nWhen go-slug performs an extraction, the filename/extraction path is taken from the tar entry via the header.Name. It was discovered that the unpacking step improperly validated paths, potentially leading to path traversal, allowing an attacker to write an arbitrary file during extraction.\n\n## Remediation\nConsumers of the go-slug shared library should evaluate the risk associated with this issue in the context of their go-slug usage and upgrade go-slug to 0.16.3 or later.",
  "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.16.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-0377"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.hashicorp.com/t/hcsec-2025-01-hashicorp-go-slug-vulnerable-to-zip-slip-attack"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/hashicorp/go-slug"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-59" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-01-21T20:27:08Z",
    "nvd_published_at" : "2025-01-21T16:15:14Z"
  }
}