CVE-2026-18508
MediumCVSS 4.4Exploitation Probability (EPSS)
Low risk3th percentile - higher than 3% of all known CVEs
Summary
GNU tar has a vulnerability when extracting an archive with the --one-top-level option. Hardlink targets are not confined to the designated top-level directory and may resolve relative to the extraction working directory. A crafted archive can create hardlinks that escape the intended boundary and, when combined with a preexisting symbolic link under the working directory, may allow writing outside that boundary during a single extraction.
Risk Assessment
An attacker could exploit this vulnerability to write files outside the intended target directory, potentially leading to overwriting system files or privilege escalation.
Recommendation
Update GNU tar to a version where the vulnerability is fixed, and avoid extracting archives from untrusted sources with the --one-top-level option.
Other vulnerabilities in GNU tar
See all- CVE-2025-45582Medium
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 containing a ../ symlink to a critical directory. Second, the victim must extract an archive containing a critical file specified via a relative pathname that begins with the symlink name and ends with the critical file's name, bypassing the 'Member name contains ..' protection.
- CVE-2016-6321High
Directory traversal vulnerability in the safer_name_suffix function in GNU tar versions 1.14 through 1.29 may allow remote attackers to bypass an intended protection mechanism and write to arbitrary files due to improper sanitization of the file_name parameter.
- CVE-2026-18477Medium
GNU tar has a TOCTOU vulnerability in incremental dumpdir 'X' rename handling. A local attacker with write access to a directory being backed up can influence the restore process if they have access to the system where the restore is performed. During restoration, files or directories may be created, renamed, or overwritten outside the intended extraction directory, potentially leading to unauthorized file modification or privilege escalation.
- CVE-2022-48303Medium
GNU Tar through 1.34 has a one-byte out-of-bounds read resulting in use of uninitialized memory for a conditional jump. The issue occurs in from_header in list.c via a V7 archive where mtime has approximately 11 whitespace characters.
- CVE-2019-9923High
pax_decode_header in sparse.c in GNU Tar before 1.32 had a NULL pointer dereference when parsing certain archives that have malformed extended headers.
- CVE-2018-20482Medium
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
- CVE-1999-0202High
The GNU tar command, when used in FTP sessions, may allow an attacker to execute arbitrary commands.
Original NVD description (English source)
A flaw was found in GNU tar. When extracting an archive with the --one-top-level option, hardlink targets are not confined to the designated top-level directory and may resolve relative to the extraction working directory. A crafted archive can create hardlinks that escape the intended boundary and, when combined with a preexisting symbolic link under the working directory, may allow writing outside that boundary during a single extraction.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

