Vulnerabilities in pkg:golang/github.com/mholt/archiver/v3

PACKAGE
Advisory Identifier: GHSA-rhh4-rh7c-7r5v
Advisory Summary

CVE-2024-0406 is a MODERATE (CVSS 6.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/mholt/archiver/v3 libraries in the Go ecosystem. The issue involves archiver path traversal vulnerability. Remediation is available in the latest vendor maintenance releases.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/mholt/archiver/v3

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/mholt/archiver/v3. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-rhh4-rh7c-7r5v CVE-2024-0406 MODERATE Archiver Path Traversal vulnerability
GHSA-7vpp-9cxj-q8gv CVE-2025-3445 HIGH mholt/archiver Vulnerable to Path Traversal via Crafted ZIP File

CVE-2024-0406 at a Glance

CVE Identifier CVE-2024-0406
GHSA Identifier GHSA-rhh4-rh7c-7r5v
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/mholt/archiver/v3
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

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:H/A:N).

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

How to Fix CVE-2024-0406

To remediate this vulnerability, upgrade all affected Github.com/mholt/archiver/v3 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/mholt/archiver/v3 fixed: Latest secure release
Upgrade github.com/mholt/archiver/v3 to Latest secure release
github.com/mholt/archiver fixed: Latest secure release
Upgrade github.com/mholt/archiver to Latest secure release
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/mholt/archiver/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-0406, inspect your project dependencies for Github.com/mholt/archiver/v3:

inspect dependencies for github.com/mholt/archiver/v3

Analyze the terminal output to locate any version of Github.com/mholt/archiver/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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/mholt/archiver/v3, 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

A flaw was discovered in the mholt/archiver package. This flaw allows an attacker to create a specially crafted tar file, which, when unpacked, may allow access to restricted files or directories. This issue can allow the creation or overwriting of files with the user's or application's privileges using the library.

CVE-2024-0406 Affected Github.com/mholt/archiver/v3 Versions

2 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/mholt/archiver/v3
Go
≥ 3.0.0
≤ 3.5.1
github.com/mholt/archiver
Go
≥ 3.0.0
≤ 3.5.1

References

Frequently Asked Questions

What is CVE-2024-0406?
CVE-2024-0406 is a security vulnerability in Github.com/mholt/archiver/v3 involving Archiver Path Traversal vulnerability under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/mholt/archiver/v3 versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/mholt/archiver/v3, github.com/mholt/archiver.
What version fixes CVE-2024-0406?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/mholt/archiver/v3 affected?
Yes, github.com/mholt/archiver/v3 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is github.com/mholt/archiver affected?
Yes, github.com/mholt/archiver is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-0406?
CVE-2024-0406 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2024-0406?
CVE-2024-0406 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check Go dependencies for CVE-2024-0406?
Run the dependency tree command: 'inspect dependencies for github.com/mholt/archiver/v3'. 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-rhh4-rh7c-7r5v",
  "modified" : "2025-05-07T01:45:49Z",
  "published" : "2024-04-06T18:31:17Z",
  "aliases" : [ "CVE-2024-0406" ],
  "summary" : "Archiver Path Traversal vulnerability",
  "details" : "A flaw was discovered in the mholt/archiver package. This flaw allows an attacker to create a specially crafted tar file, which, when unpacked, may allow access to restricted files or directories. This issue can allow the creation or overwriting of files with the user's or application's privileges using the library.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/mholt/archiver/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "last_affected" : "3.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/mholt/archiver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "last_affected" : "3.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-0406"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2025:2449"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2024-0406"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2257749"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mholt/archiver"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-2698"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-08T15:44:41Z",
    "nvd_published_at" : "2024-04-06T17:15:07Z"
  }
}