Tar GNU Tar

Don't miss out!

Thousands of developers use stack.watch to stay informed.
Get an email whenever new security vulnerabilities are reported in GNU Tar.

By the Year

In 2026 there have been 0 vulnerabilities in GNU Tar. Last year, in 2025 Tar had 2 security vulnerabilities published. Right now, Tar is on track to have less security vulnerabilities in 2026 than it did last year.




Year Vulnerabilities Average Score
2026 0 0.00
2025 2 4.20
2024 1 6.20
2023 1 5.50
2022 4 8.45
2021 1 0.00
2020 0 0.00
2019 1 7.50
2018 1 0.00

It may take a day or so for new Tar vulnerabilities to show up in the stats or in the list of recent security vulnerabilities. Additionally vulnerabilities may be tagged under a different product or component name.

Recent GNU Tar Security Vulnerabilities

GNU tar 1.0: tar.Reader Sparse Region DoS via Unbounded Allocation
CVE-2025-58183 4.3 - Medium - October 29, 2025

tar.Reader does not set a maximum size on the number of sparse region data blocks in GNU tar pax 1.0 sparse files. A maliciously-crafted archive containing a large number of sparse regions can cause a Reader to read an unbounded amount of data from the archive into memory. When reading from a compressed source, a small compressed input can result in large allocations.

GNU Tar <1.35 Directory Traversal + File Overwrite via Double Extraction
CVE-2025-45582 4.1 - Medium - July 11, 2025

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.

Path Traversal: '../filedir'

Crash via mishandled PAX extension attributes in GNU tar < 1.35
CVE-2023-39804 6.2 - Medium - March 27, 2024

In GNU tar before 1.35, mishandled extension attributes in a PAX archive can lead to an application crash in xheader.c.

GNU Tar 1.34 One-Byte OOB Read in from_header (V7)
CVE-2022-48303 5.5 - Medium - January 30, 2023

GNU Tar through 1.34 has a one-byte out-of-bounds read that results in use of uninitialized memory for a conditional jump. Exploitation to change the flow of control has not been demonstrated. The issue occurs in from_header in list.c via a V7 archive in which mtime has approximately 11 whitespace characters.

Out-of-bounds Read

GNU tar: Path Traversal via Improper Path Sanitization (CVE-2020-36560)
CVE-2020-36560 9.1 - Critical - December 27, 2022

Due to improper path sanitization, archives containing relative file paths can cause files to be written (or overwritten) outside of the target directory.

Directory traversal

Archive Extractor Improper Link Resolution Allows ACL Escalation
CVE-2021-23177 7.8 - High - August 23, 2022

An improper link resolution flaw while extracting an archive can lead to changing the access control list (ACL) of the target of the link. An attacker may provide a malicious archive to a victim user, who would trigger this flaw when trying to extract the archive. A local attacker may use this flaw to change the ACL of a file on the system and gain more privileges.

insecure temporary file

Memory Leak in GNU tar's th_read() due to Unfreeing gnu_longname
CVE-2021-33646 - August 10, 2022

The th_read() function doesnt free a variable t->th_buf.gnu_longname after allocating memory, which may cause a memory leak.

Memory Leak

GNU Tar OOB Read via crafted tar header (malloc(0))
CVE-2021-33644 - August 10, 2022

An attacker who submits a crafted tar file with size in header struct being 0 may be able to trigger an calling of malloc(0) for a variable gnu_longname, causing an out-of-bounds read.

Out-of-bounds Read

A flaw was found in the src/list.c of tar 1.33 and earlier
CVE-2021-20193 - March 26, 2021

A flaw was found in the src/list.c of tar 1.33 and earlier. This flaw allows an attacker who can submit a crafted input file to tar to cause uncontrolled consumption of memory. The highest threat from this vulnerability is to system availability.

Memory Leak

pax_decode_header in sparse.c in GNU Tar before 1.32 had a NULL pointer dereference when parsing certain archives
CVE-2019-9923 7.5 - High - March 22, 2019

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.

NULL Pointer Dereference

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
CVE-2018-20482 - December 26, 2018

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).

Directory traversal vulnerability in the safer_name_suffix function in GNU tar 1.14 through 1.29 might
CVE-2016-6321 7.5 - High - December 09, 2016

Directory traversal vulnerability in the safer_name_suffix function in GNU tar 1.14 through 1.29 might allow remote attackers to bypass an intended protection mechanism and write to arbitrary files via vectors related to improper sanitization of the file_name parameter, aka POINTYFEATHER.

Directory traversal

Buffer overflow in the safer_name_suffix function in GNU tar has unspecified attack vectors and impact, resulting in a "crashing stack
CVE-2007-4476 - September 05, 2007

Buffer overflow in the safer_name_suffix function in GNU tar has unspecified attack vectors and impact, resulting in a "crashing stack."

Tar 1.15.1 does not properly warn the user when extracting setuid or setgid files, which may
CVE-2005-2541 - August 10, 2005

Tar 1.15.1 does not properly warn the user when extracting setuid or setgid files, which may allow local users or remote attackers to gain privileges.

Stay on top of Security Vulnerabilities

Want an email whenever new vulnerabilities are published for GNU Tar or by GNU? Click the Watch button to subscribe.

GNU
Vendor

GNU Tar
Product

subscribe