vendor:
Archive_Tar
by:
farisv
8.8
CVSS
HIGH
PHP Object Injection
502
CWE
Product Name: Archive_Tar
Affected Version From: 1.4.3
Affected Version To: 1.4.3
Patch Exists: YES
Related CWE: CVE-2018-1000888
CPE: a:pear:archive_tar:1.4.3
Metasploit:
https://www.rapid7.com/db/vulnerabilities/drupal-cve-2019-6338/, https://www.rapid7.com/db/vulnerabilities/debian-cve-2019-6338/, https://www.rapid7.com/db/vulnerabilities/amazon-linux-ami-2-cve-2018-1000888/, https://www.rapid7.com/db/vulnerabilities/gentoo-linux-cve-2018-1000888/, https://www.rapid7.com/db/vulnerabilities/debian-cve-2018-1000888/, https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp2-cve-2018-1000888/, https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp5-cve-2018-1000888/, https://www.rapid7.com/db/vulnerabilities/drupal-cve-2018-1000888/, https://www.rapid7.com/db/vulnerabilities/ubuntu-cve-2018-1000888/, https://www.rapid7.com/db/vulnerabilities/suse-cve-2018-1000888/
Other Scripts:
N/A
Platforms Tested: None
2019
PEAR Archive_Tar < 1.4.4 - PHP Object Injection
In PEAR Archive_Tar before 1.4.4, there are several file operation with `$v_header['filename']` as parameter (such as file_exists, is_file, is_dir, etc). When extract() is called without a specific prefix path, we can trigger phar induced unserialization by crafting a tar file with `phar://[path_to_malicious_phar_file]` as path name. Object injection can be used to trigger destructor/wakeup method in the loaded PHP classes, e.g. the Archive_Tar class itself. With Archive_Tar itself, we can trigger arbitrary file deletion because `@unlink($this->_temp_tarname)` will be called in the destructor method. If another class with useful gadget is loaded, remote code execution may be possible.
Mitigation:
Upgrade to version 1.4.4 or later.