CVE-2025-45582 Path traversal in Tar

Medium 4.1 Published Updated

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:10All versions2:1.35-9.el10_1
tar AlmaLinux:9All versions2:1.34-9.el9_7
tar Red Hat:enterprise_linux:10.1All versions2:1.35-9.el10_1
tar-debuginfo Red Hat:enterprise_linux:10.1All versions2:1.35-9.el10_1
tar-debugsource Red Hat:enterprise_linux:10.1All versions2:1.35-9.el10_1
tar Red Hat:enterprise_linux:9::baseosAll versions2:1.34-9.el9_7
tar-debuginfo Red Hat:enterprise_linux:9::baseosAll versions2:1.34-9.el9_7
tar-debugsource Red Hat:enterprise_linux:9::baseosAll versions2:1.34-9.el9_7
tar Red Hat:enterprise_linux_eus:10.0All versions2:1.35-7.el10_0.2
tar Red Hat:rhel_eus:9.4::baseosAll versions2:1.34-6.el9_4.3
tar-debuginfo Red Hat:rhel_eus:9.4::baseosAll versions2:1.34-6.el9_4.3
tar-debugsource Red Hat:rhel_eus:9.4::baseosAll versions2:1.34-6.el9_4.3
tar Red Hat:rhel_eus:9.6::baseosAll versions2:1.34-7.el9_6.2
tar Rocky Linux:10All versions2:1.35-9.el10_1
tar Rocky Linux:9All versions2:1.34-9.el9_7
tar SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Micro 5.2All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Micro 5.3All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Micro 5.4All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Micro 5.5All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Module for Basesystem 15 SP7All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Server 12 SP5-LTSSAll versions1.34-15.27.1
tar SUSE:Linux Enterprise Server 15 SP4-LTSSAll versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Server 15 SP5-LTSSAll versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Server 15 SP6-LTSSAll versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Server 16.0All versions1.35-160000.3.1
tar SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5All versions1.34-15.27.1
tar SUSE:Linux Enterprise Server for SAP Applications 15 SP4All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Server for SAP Applications 15 SP5All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Server for SAP Applications 15 SP6All versions1.34-150000.3.37.1
tar SUSE:Linux Enterprise Server for SAP applications 16.0All versions1.35-160000.3.1
tar SUSE:Linux Micro 6.0All versions1.35-3.1
tar SUSE:Linux Micro 6.1All versions1.35-slfo.1.1_3.1
tar SUSE:Linux Micro 6.2All versions1.35-160000.3.1
tar openSUSE:Leap 15.6All versions1.34-150000.3.37.1
tar openSUSE:Leap 16.0All versions1.35-160000.3.1
tar openSUSE:TumbleweedAll versions1.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.

Sources

Also known as ALSA-2026:0002, ALSA-2026:0067, AZL-65082, AZL-65538, BELL-CVE-2025-45582, CLSA-2026-1769513855 and 26 more.

Is CVE-2025-45582 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free