CVE-2020-28948
Description
Archive_Tar through 1.4.10 allows an unserialization attack because phar: is blocked but PHAR: is not blocked.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Archive_Tar through 1.4.10 allows unserialization attack by bypassing phar:// block with uppercase PHAR://.
Vulnerability
CVE-2020-28948 is an unserialization vulnerability in the PEAR Archive_Tar library, affecting versions through 1.4.10. The library attempts to block malicious filenames that start with phar:// to prevent PHP phar unserialization attacks, but the check is case-sensitive. An attacker can bypass this protection by using PHAR:// (uppercase) in the filename, which is not blocked [1][2].
Exploitation
To exploit this, an attacker crafts a tar archive containing a file whose name begins with PHAR:// and points to a malicious phar file. When Archive_Tar processes the archive (e.g., during extraction or listing), the _maliciousFilename() function fails to detect the uppercase scheme, allowing the phar metadata to be unserialized. This attack requires that phar.readonly is disabled in PHP configuration, and the attacker must be able to upload or supply a crafted tar file to an application using Archive_Tar [2].
Impact
Successful exploitation leads to arbitrary PHP object injection, which can result in remote code execution. The Drupal project, which uses Archive_Tar, issued a critical security advisory (SA-CORE-2020-013) noting that known exploits exist for this vulnerability in certain configurations, such as when untrusted users can upload .tar, .tar.gz, .bz2, or .tlz files [3].
Mitigation
The vulnerability is fixed in Archive_Tar versions after 1.4.10. The commit [4] changes the check to block any stream wrapper (://) instead of only phar://, and renames the method to _isMaliciousFilename. Users should update to the latest version of Archive_Tar or apply the patch. Drupal has released updates (7.75, 8.8.12, 8.9.10, 9.0.9) that include the fix [3]. As a workaround, prevent untrusted users from uploading tar archives until patching is possible.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
pear/archive_tarPackagist | < 1.4.11 | 1.4.11 |
Affected products
40- Archive_Tar/Archive_Tardescription
- osv-coords39 versionspkg:bitnami/drupalpkg:composer/pear/archive_tarpkg:rpm/almalinux/apcu-panelpkg:rpm/almalinux/libzippkg:rpm/almalinux/libzip-develpkg:rpm/almalinux/libzip-toolspkg:rpm/almalinux/phppkg:rpm/almalinux/php-bcmathpkg:rpm/almalinux/php-clipkg:rpm/almalinux/php-commonpkg:rpm/almalinux/php-dbapkg:rpm/almalinux/php-dbgpkg:rpm/almalinux/php-develpkg:rpm/almalinux/php-embeddedpkg:rpm/almalinux/php-enchantpkg:rpm/almalinux/php-ffipkg:rpm/almalinux/php-fpmpkg:rpm/almalinux/php-gdpkg:rpm/almalinux/php-gmppkg:rpm/almalinux/php-intlpkg:rpm/almalinux/php-jsonpkg:rpm/almalinux/php-ldappkg:rpm/almalinux/php-mbstringpkg:rpm/almalinux/php-mysqlndpkg:rpm/almalinux/php-odbcpkg:rpm/almalinux/php-opcachepkg:rpm/almalinux/php-pdopkg:rpm/almalinux/php-pearpkg:rpm/almalinux/php-pecl-apcupkg:rpm/almalinux/php-pecl-apcu-develpkg:rpm/almalinux/php-pecl-rrdpkg:rpm/almalinux/php-pecl-xdebugpkg:rpm/almalinux/php-pecl-zippkg:rpm/almalinux/php-pgsqlpkg:rpm/almalinux/php-processpkg:rpm/almalinux/php-snmppkg:rpm/almalinux/php-soappkg:rpm/almalinux/php-xmlpkg:rpm/almalinux/php-xmlrpc
>= 7.0.0, < 7.75.0+ 38 more
- (no CPE)range: >= 7.0.0, < 7.75.0
- (no CPE)range: < 1.4.11
- (no CPE)range: < 5.1.18-1.module_el8.6.0+2750+78feabcb
- (no CPE)range: < 1.6.1-1.module_el8.6.0+2750+78feabcb
- (no CPE)range: < 1.6.1-1.module_el8.6.0+2750+78feabcb
- (no CPE)range: < 1.6.1-1.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 1:1.10.13-1.module_el8.6.0+3268+b150a051
- (no CPE)range: < 5.1.18-1.module_el8.6.0+2750+78feabcb
- (no CPE)range: < 5.1.18-1.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 2.0.1-1.module_el8.6.0+2750+78feabcb
- (no CPE)range: < 2.9.5-1.module_el8.6.0+3239+bedf0508
- (no CPE)range: < 1.18.2-1.module_el8.6.0+2750+78feabcb
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
- (no CPE)range: < 7.4.19-4.module_el8.6.0+3238+624bf8b8
Patches
10670a05fdab9Fixes #33 - ensure we catch additional malicious/crafted filenames
1 file changed · +4 −4
Archive/Tar.php+4 −4 modified@@ -1730,7 +1730,7 @@ public function _readHeader($v_binary_data, &$v_header) // ----- Extract the properties $v_header['filename'] = rtrim($v_data['filename'], "\0"); - if ($this->_maliciousFilename($v_header['filename'])) { + if ($this->_isMaliciousFilename($v_header['filename'])) { $this->_error( 'Malicious .tar detected, file "' . $v_header['filename'] . '" will not install in desired directory tree' @@ -1800,9 +1800,9 @@ private function _tarRecToSize($tar_size) * * @return bool */ - private function _maliciousFilename($file) + private function _isMaliciousFilename($file) { - if (strpos($file, 'phar://') === 0) { + if (strpos($file, '://') !== false) { return true; } if (strpos($file, '../') !== false || strpos($file, '..\\') !== false) { @@ -1838,7 +1838,7 @@ public function _readLongHeader(&$v_header) $v_filename = rtrim(substr($v_filename, 0, $v_filesize), "\0"); $v_header['filename'] = $v_filename; - if ($this->_maliciousFilename($v_filename)) { + if ($this->_isMaliciousFilename($v_filename)) { $this->_error( 'Malicious .tar detected, file "' . $v_filename . '" will not install in desired directory tree'
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
20- github.com/advisories/GHSA-jh5x-hfhg-78jqghsaADVISORY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/42GPGVVFTLJYAKRI75IVB5R45NYQGEUR/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4V35LBRM6HBCXBVCITKQ4UEBTXO2EG7B/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5KSFM672XW3X6BR7TVKRD63SLZGKK437/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KWM4CTMEGAC4I2CHYNJVSROY4CVXVEUT/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NBYZSHYTIOBK6V7C4N7TP6KIKCRKLVWP/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VJQQYDAOWHD6RDITDRPHFW7WY6BS3V5N/mitrevendor-advisoryx_refsource_FEDORA
- nvd.nist.gov/vuln/detail/CVE-2020-28948ghsaADVISORY
- security.gentoo.org/glsa/202101-23ghsavendor-advisoryx_refsource_GENTOOWEB
- www.debian.org/security/2020/dsa-4817ghsavendor-advisoryx_refsource_DEBIANWEB
- github.com/pear/Archive_Tar/commit/0670a05fdab997036a3fc3ef113b8f5922e574daghsaWEB
- github.com/pear/Archive_Tar/issues/33ghsax_refsource_MISCWEB
- lists.debian.org/debian-lts-announce/2020/11/msg00045.htmlghsamailing-listx_refsource_MLISTWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/42GPGVVFTLJYAKRI75IVB5R45NYQGEURghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4V35LBRM6HBCXBVCITKQ4UEBTXO2EG7BghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5KSFM672XW3X6BR7TVKRD63SLZGKK437ghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KWM4CTMEGAC4I2CHYNJVSROY4CVXVEUTghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NBYZSHYTIOBK6V7C4N7TP6KIKCRKLVWPghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VJQQYDAOWHD6RDITDRPHFW7WY6BS3V5NghsaWEB
- www.drupal.org/sa-core-2020-013ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.