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.
- 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
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
Which versions are affected by CVE-2025-45582?
It affects 1 product.
Linux distribution packages (40)
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 include Gnu Tar.
How do I fix CVE-2025-45582?
Apply the vendor's patch.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
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
Sources
Also known as ALSA-2026:0002, ALSA-2026:0067, AZL-65082, AZL-65538, BELL-CVE-2025-45582, CLSA-2026-1769513855 and 26 more.