Archive::Tar Hardlink Vulnerability in Perl Allowing Insecure Extraction and File Modification

Vulnerability

A vulnerability exists in Archive::Tar versions prior to 3.08 for Perl, where the extraction of hardlinks can lead to unauthorized file modifications. The issue arises because the '_make_special_file()' function transfers the linkname from the tar header to the 'link()' system call without proper validation against absolute paths or directory traversal segments. This flaw enables the creation of hardlinks that share the same inode as the original file. Consequently, any modifications made through the extracted link overwrite the original file. Additionally, during the extraction process, the tar header's file permissions, ownership, and timestamps are applied to the shared inode, further complicating the issue.

Impact

Exploitation of this vulnerability allows for unauthorized modifications of files through manipulated hardlinks, potentially leading to data loss or corruption.

Reproduction

The vulnerability can be reproduced by creating a tar archive that includes hardlinks with attacker-controlled linknames that traverse directories or point to absolute paths. When this archive is extracted with a version of Archive::Tar prior to 3.08, the hardlinks will be created without the necessary validation, allowing for the described file modification behavior.

Remediation

Users can upgrade to Archive::Tar version 3.08 or later, where this vulnerability has been addressed.

Added: May 26, 2026, 5:51 PM
Updated: May 26, 2026, 5:51 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
0.6
exploitability
5.3
remediation
7.7
relevance
9.6
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.