# CVE-2025-45582: Path traversal in Tar

> Attackers can overwrite critical files like SSH keys by exploiting symlink traversal in multi-step TAR extractions, affecting systems relying on tar for untrusted archives.

- **Severity:** Medium 4.1 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:N/I:L/A:L`)
- **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:** 11 Jul 2025
- **Updated:** 2 Nov 2025
- **Also known as:** ALSA-2026:0002, ALSA-2026:0067, AZL-65082, AZL-65538, BELL-CVE-2025-45582, CLSA-2026-1769513855, CLSA-2026-1769598463, GHSA-f93m-9mq4-2fjj, JLSEC-2025-197, OESA-2026-1091, OESA-2026-1092, OESA-2026-1093, OESA-2026-1094, OESA-2026-1095, OESA-2026-1096, RHSA-2026:0002, RHSA-2026:0067, RHSA-2026:0135, RHSA-2026:0434, RHSA-2026:0435, RLSA-2026:0002, RLSA-2026:0067, SUSE-SU-2026:1177-1, SUSE-SU-2026:20955-1, SUSE-SU-2026:20959-1, SUSE-SU-2026:21002-1, SUSE-SU-2026:21143-1, SUSE-SU-2026:2615-1, UBUNTU-CVE-2025-45582, USN-8510-1, openSUSE-SU-2026:10743-1, openSUSE-SU-2026:20472-1

## What is CVE-2025-45582?

CVE-2025-45582 is a medium-severity path traversal vulnerability in GNU Tar, published on 11 Jul 2025. 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

GNU Tar through 1.35 allows file overwrite via directory traversal in crafted TAR archives, with a certain two-step process. First, the victim must extract an archive that contains a ../ symlink to a critical directory. Second, the victim must extract an archive that contains a critical file, specified via a relative pathname that begins with the symlink name and ends with that critical file's name. Here, the extraction follows the symlink and overwrites the critical file. This bypasses the protection mechanism of "Member name contains '..'" that would occur for a single TAR archive that attempted to specify the critical file via a ../ approach. For example, the first archive can contain "x -> ../../../../../home/victim/.ssh" and the second archive can contain x/authorized_keys. This can affect server applications that automatically extract any number of user-supplied TAR archives, and were relying on the blocking of traversal. This can also affect software installation processes in which "tar xf" is run more than once (e.g., when installing a package can automatically install two dependencies that are set up as untrusted tarballs instead of official packages). NOTE: the official GNU Tar manual has an otherwise-empty directory for each "tar xf" in its Security Rules of Thumb; however, third-party advice leads users to run "tar xf" more than once into the same directory.

Weakness: CWE-24 (Path Traversal: '../filedir')

## Which versions are affected by CVE-2025-45582?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `tar` | AlmaLinux:10 | All versions | 2:1.35-9.el10_1 |
| `tar` | AlmaLinux:9 | All versions | 2:1.34-9.el9_7 |
| `tar` | Red Hat:enterprise_linux:10.1 | All versions | 2:1.35-9.el10_1 |
| `tar-debuginfo` | Red Hat:enterprise_linux:10.1 | All versions | 2:1.35-9.el10_1 |
| `tar-debugsource` | Red Hat:enterprise_linux:10.1 | All versions | 2:1.35-9.el10_1 |
| `tar` | Red Hat:enterprise_linux:9::baseos | All versions | 2:1.34-9.el9_7 |
| `tar-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 2:1.34-9.el9_7 |
| `tar-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 2:1.34-9.el9_7 |
| `tar` | Red Hat:enterprise_linux_eus:10.0 | All versions | 2:1.35-7.el10_0.2 |
| `tar` | Red Hat:rhel_eus:9.4::baseos | All versions | 2:1.34-6.el9_4.3 |
| `tar-debuginfo` | Red Hat:rhel_eus:9.4::baseos | All versions | 2:1.34-6.el9_4.3 |
| `tar-debugsource` | Red Hat:rhel_eus:9.4::baseos | All versions | 2:1.34-6.el9_4.3 |
| `tar` | Red Hat:rhel_eus:9.6::baseos | All versions | 2:1.34-7.el9_6.2 |
| `tar` | Rocky Linux:10 | All versions | 2:1.35-9.el10_1 |
| `tar` | Rocky Linux:9 | All versions | 2:1.34-9.el9_7 |
| `tar` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Micro 5.2 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Micro 5.3 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Micro 5.4 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Micro 5.5 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Server 12 SP5-LTSS | All versions | 1.34-15.27.1 |
| `tar` | SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Server 15 SP5-LTSS | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Server 15 SP6-LTSS | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Server 16.0 | All versions | 1.35-160000.3.1 |
| `tar` | SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | All versions | 1.34-15.27.1 |
| `tar` | SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Server for SAP Applications 15 SP6 | All versions | 1.34-150000.3.37.1 |
| `tar` | SUSE:Linux Enterprise Server for SAP applications 16.0 | All versions | 1.35-160000.3.1 |
| `tar` | SUSE:Linux Micro 6.0 | All versions | 1.35-3.1 |
| `tar` | SUSE:Linux Micro 6.1 | All versions | 1.35-slfo.1.1_3.1 |
| `tar` | SUSE:Linux Micro 6.2 | All versions | 1.35-160000.3.1 |
| `tar` | openSUSE:Leap 15.6 | All versions | 1.34-150000.3.37.1 |
| `tar` | openSUSE:Leap 16.0 | All versions | 1.35-160000.3.1 |
| `tar` | openSUSE:Tumbleweed | All versions | 1.35-7.1 |

Products: Gnu Tar.

## How do I fix CVE-2025-45582?

Apply the vendor's patch.

## Is CVE-2025-45582 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-45582 exists.

## Other vulnerabilities in GNU Tar

- [CVE-2005-2541](https://insights.sbomify.com/CVE-2005-2541/): Privilege escalation in n/a (critical 10.0)
- [CVE-2019-9923](https://insights.sbomify.com/CVE-2019-9923/): Null dereference in n/a (high 7.5)
- [CVE-2016-6321](https://insights.sbomify.com/CVE-2016-6321/): Path traversal in n/a (high 7.5)
- [CVE-2007-4131](https://insights.sbomify.com/CVE-2007-4131/): Path traversal in n/a (medium 6.8)
- [CVE-2023-39804](https://insights.sbomify.com/CVE-2023-39804/): Denial of service in n/a (medium 6.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-45582 and fix it if it is affected.

What it is: CVE-2025-45582 is a medium-severity path traversal vulnerability in GNU Tar, published on 11 Jul 2025. 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: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-45582 exists.

Affected product: GNU Tar. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-2025-45582/ (Markdown: https://insights.sbomify.com/CVE-2025-45582/index.md)
```

## Sources

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

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