# CVE-2024-0406: Mholt/archiver: path traversal vulnerability

> Attackers can exploit a path traversal flaw in the Go archiver library to read or overwrite restricted files via crafted tar archives.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Apr 2024
- **Updated:** 20 Nov 2025
- **Also known as:** GHSA-rhh4-rh7c-7r5v, GO-2024-2698, MINI-2c7v-j2m5-vrmf, MINI-36h7-cmxx-2jfc, MINI-7995-wxrw-p2j7, MINI-7qh4-69f5-98g2, MINI-mfr4-pmhc-mccr, MINI-qj32-xphp-54g7, openSUSE-SU-2025:14996-1, openSUSE-SU-2025:15004-1

## What is CVE-2024-0406?

CVE-2024-0406 is a medium-severity path traversal vulnerability in Redhat Openshift Container Platform, published on 6 Apr 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-0406?

6 open source packages ship an affected version, including github.com/mholt/archiver and github.com/mholt/archiver/v3. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/mholt/archiver` | Go | All versions | None |
| `github.com/mholt/archiver` | Go | From 3.0.0 to 3.5.1 | None |
| `github.com/mholt/archiver` | Go | From 3.0.0 to 3.5.1 | None |
| `github.com/mholt/archiver/v3` | Go | All versions | None |
| `github.com/mholt/archiver/v3` | Go | From 3.0.0 to 3.5.1 | None |
| `github.com/mholt/archiver/v3` | Go | From 3.0.0 to 3.5.1 | None |
| `hauler` | openSUSE:Tumbleweed | All versions | 1.2.2-1.1 |
| `subfinder` | openSUSE:Tumbleweed | All versions | 2.7.0-2.1 |

Products: Mholt Archiver, Redhat Advanced Cluster Security, Redhat Openshift Container Platform.

## How do I fix CVE-2024-0406?

Upgrade to a fixed version.

## Is CVE-2024-0406 being exploited?

There is no known exploitation of CVE-2024-0406 in the wild and no public exploit code.

Public exploit code:

- CVE-2024-0406 POC using symlinks (github_poc): https://github.com/walidpyh/CVE-2024-0406-POC
- vulnerable web app CVE-2024-0406 go cve (github_poc): https://github.com/veissa/Desires

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-0406 and fix it if it is affected.

What it is: CVE-2024-0406 is a medium-severity path traversal vulnerability in Redhat Openshift Container Platform, published on 6 Apr 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-0406 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/mholt/archiver (Go): affected all versions; no fix listed
- github.com/mholt/archiver (Go): affected from 3.0.0 up to 3.5.1; no fix listed
- github.com/mholt/archiver (Go): affected from 3.0.0 up to 3.5.1; no fix listed
- github.com/mholt/archiver/v3 (Go): affected all versions; no fix listed
- github.com/mholt/archiver/v3 (Go): affected from 3.0.0 up to 3.5.1; no fix listed
- github.com/mholt/archiver/v3 (Go): affected from 3.0.0 up to 3.5.1; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-0406/ (Markdown: https://insights.sbomify.com/CVE-2024-0406/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-0406
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-0406
- OSV: https://osv.dev/vulnerability/CVE-2024-0406

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-0406/
Summaries are generated and may contain mistakes; the official description above is the record.
