CVE-2025-45582
NoneCVSS
—
EPSS
0.5%
Published
Jul 11, 2025
CISA due date
—
Cloudanix analysis
A flaw in the widely used tar tool lets attackers replace important system files when software automatically unpacks specially made archive files in two steps, which could let someone take control of a computer.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- Application
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
GNU Tar through 1.35 permits arbitrary file overwrite by bypassing its directory traversal check when two separate archives are extracted in sequence: the first creates a symlink pointing outside the extraction root, and the second uses a relative path that follows the symlink to overwrite a target file.
Why it matters to the business
Automated extraction of untrusted archives or multi-step package installation processes on affected Linux systems can result in silent replacement of critical files such as SSH keys or configuration, enabling unauthorized access or system compromise; the issue affects widely used Linux LTS packages but carries low exploitation likelihood based on current threat data.
How an attack unfolds
An attacker supplies two crafted tar archives to any process that extracts user-controlled or third-party tarballs without additional validation. The first archive contains a symlink such as "x -> ../../../../../home/victim/.ssh"; the second archive contains a file entry such as "x/authorized_keys". When both are extracted in order, tar follows the symlink created by the first archive and overwrites the target file. This technique has not been observed in active campaigns or ransomware and shows no public exploit maturity.
How to fix it
Upgrade the affected linux-lts packages to the listed fixed versions: Alpaquita 23 to 6.1.81-r0, Alpaquita stream to 6.6.58-r0 or 6.12.41-r0, and Alpaquita 25 to 6.12.41-r0. After upgrade, re-verify that extraction processes reject or sanitize symlinks and relative paths that could traverse outside the intended directory.
How to confirm the fix worked
Confirm the installed tar version is at or above the fixed package revisions, run extraction tests with the two-archive symlink technique to ensure overwrites are blocked, and review any automated tar extraction code paths for additional path sanitization.
Typical attack path
- Attacker prepares two malicious tar archives using the symlink-then-file technique
- Victim or automated process extracts the first archive, creating the symlink
- Victim or automated process extracts the second archive, causing the file write to follow the symlink
- Critical file (SSH key, config, binary, etc.) is overwritten with attacker-controlled content
- Attacker gains access or persistence on the next legitimate use of the overwritten file
How to detect it
Review process execution logs and file-system monitoring for sequences where tar creates a symlink followed immediately by extraction of a relative path that resolves through that symlink; inspect any automated build or package-installation pipelines that invoke tar multiple times on external archives.
What your security team should do
- Apply the listed fixed linux-lts package versions immediately on all affected Alpaquita systems
- Audit and restrict automated tar extraction of untrusted archives to a single trusted source or add symlink and path validation before extraction
- Monitor package installation and archive extraction logs for unexpected symlink creation followed by file writes
- Consider replacing tar-based extraction with libraries that enforce strict destination-path checks
The record
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).
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:10 | tar | 0 | 2:1.35-9.el10_1 |
| AlmaLinux:9 | tar | 0 | 2:1.34-9.el9_7 |
| Debian:11 | tar | 0 | No fix |
| Debian:12 | tar | 0 | No fix |
| Debian:13 | tar | 0 | No fix |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Micro 5.2 | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Micro 5.3 | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Micro 5.4 | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Micro 5.5 | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP7 | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Server 15 SP5-LTSS | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Server 15 SP6-LTSS | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | tar | 0 | 1.34-150000.3.37.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP6 | tar | 0 | 1.34-150000.3.37.1 |
| openSUSE:Leap 15.6 | tar | 0 | 1.34-150000.3.37.1 |
| openSUSE:Leap 16.0 | tar | 0 | 1.35-160000.3.1 |
| openSUSE:Leap 16.0 | tar | 0 | 1.35-160000.4.1 |
| openSUSE:Tumbleweed | tar | 0 | 1.35-7.1 |
Related vulnerabilities
- CVE-2023-39804 In GNU tar before 1.35, mishandled extension attributes in a PAX archive can lead to an… Also affects tar
- CVE-2016-6321 Directory traversal vulnerability in the safer_name_suffix function in GNU tar 1.14… Also affects tar
- CVE-2010-0624 Heap-based buffer overflow in the rmt_read__ function in lib/rtapelib.c in the rmt client… Also affects tar
- CVE-2007-4476 Buffer overflow in the safer_name_suffix function in GNU tar has unspecified attack… Also affects tar
- CVE-2006-6097 GNU tar 1.16 and 1.15.1, and possibly other versions, allows user-assisted attackers to… Also affects tar
- CVE-2005-2541 Tar 1.15.1 does not properly warn the user when extracting setuid or setgid files, which… Also affects tar
- CVE-2026-5704 A flaw was found in tar. Also affects tar