CVE-2021-32610: Directory Traversal in Archive_Tar
Summary
CVE-2021-32610: Directory Traversal in Archive_Tar. Affects pear/archive_tar versions < 1.4.14. Fixed in 1.4.14. How to fix ↓
Also tracked for
- php-pear · Debian:11
The same CVE-2021-32610 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Archive_Tar package is a PHP library that provides functionality for creating and extracting tar archives. It is commonly used in PHP applications to handle file compression and decompression. Archive_Tar allows users to create, extract, and manipulate tar archives programmatically. However, a vulnerability has been discovered in versions prior to 1.4.14 that allows directory traversal attacks.
Vulnerability Detail
The vulnerability (CVE-2021-32610) in Archive_Tar allows symlinks within the extracted archive to reference files outside of the intended scope. This can lead to unauthorized access to sensitive files on the server. The issue is different from CVE-2020-36193. An attacker could exploit this vulnerability by crafting a malicious tar archive containing symlinks that point to sensitive files. When the archive is extracted, the symlinks would be followed, allowing the attacker to access files outside of the intended directory. This vulnerability has a CVSS score of 7.1, indicating a high severity.
How To Fix
Minimum fixed version
1.4.14
This is the first release that contains the fix.
composer require pear/archive_tar:1.4.14
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not immediately feasible, a temporary workaround is to manually validate and sanitize the extracted file paths. This can be done by checking if the resolved path of a symlink is within the expected directory structure. If the resolved path is outside of the expected directory, the file should be discarded or handled with caution.
Conclusion
The vulnerability in Archive_Tar (CVE-2021-32610) allows directory traversal attacks, potentially leading to unauthorized access to sensitive files. It is crucial to upgrade to version 1.4.14 or later to mitigate this vulnerability. If immediate upgrade is not possible, manual validation and sanitization of extracted file paths can serve as a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for pear/archive_tar →
FAQ
Archive_Tar is a PHP library used for creating and extracting tar archives.
Directory traversal is a vulnerability that allows an attacker to access files and directories outside of the intended scope.
This vulnerability allows an attacker to access sensitive files on the server, potentially leading to unauthorized disclosure of sensitive information.
Yes, upgrading to Archive_Tar version 1.4.14 or later fixes this vulnerability.
You can update the package by running the command 'composer require pear/archive_tar:^1.4.14'.
References
Related vulnerabilities
Recent vulnerabilities recorded for pear/archive_tar.