Updates released this week for the Drupal and TYPO3 open source content management systems (CMSs) patch vulnerabilities related to how Phar archives are handled.
The Phar (PHP Archive) package format enables developers to place all the files of a PHP application inside a single archive.
While the Phar format is highly useful, researcher Sam Thomas showed last year that it can also be abused for insecure deserialization — via the Phar stream wrapper— and arbitrary code execution by disguising malicious Phar files as text or image files. Stream wrappers are used by PHP to implement complex file handling functionality.
The security hole was addressed by TYPO3 developers a month after disclosure by introducing a Phar stream wrapper interceptor designed to ensure that Phar archives actually have a .phar extension and check Phar file metadata for potentially insecure serialized objects.
However, researchers have since discovered that the protection provided by the Phar stream wrapper interceptor, which has been released as open source, can be bypassed. A total of three bypass methods have been identified: one disclosed in October 2018 and two made public this week.
This means malicious actors could still upload specially crafted Phar files and possibly execute arbitrary code.
TYPO3 developers said the vulnerabilities affect versions 2.0.0-2.1.0 and 3.0.0-3.1.0 of the stream wrapper package and they have been addressed with the release of versions 3.1.1 (for PHP 7.0 and later) and 2.1.1 (for PHP 5.3 and later).
One of the bypass methods, which involves a path traversal issue, has also been found to impact Drupal, which also uses the TYPO3 interceptor. Drupal developers have classified the flaw as “moderately critical,” with a NIST Common Misuse Scoring System score of 14 out of 25, and patched it with the release of versions 7.67, 8.6.16 and 8.7.1.
This is not the first time Drupal has released updates designed to prevent attacks involving Phar files. In January, developers announced that .phar had been added to the list of dangerous extensions, and that the Phar stream wrapper had been disabled by default for Drupal 7 websites using versions of PHP prior to 5.3.2 to eliminate the risks highlighted by Thomas and a member of the Drupal security team.
Related: Drupal RCE Flaw Exploited in Attacks Days After Patch
Related: Symfony, jQuery Vulnerabilities Patched in Drupal
Related: Critical Drupal Vulnerability Allows Remote Code Execution

Eduard Kovacs (@EduardKovacs) is a contributing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.
More from Eduard Kovacs
- Exploitation of 55 Zero-Day Vulnerabilities Came to Light in 2022: Mandiant
- Organizations Notified of Remotely Exploitable Vulnerabilities in Aveva HMI, SCADA Products
- Waterfall Security, TXOne Networks Launch New OT Security Appliances
- Hitachi Energy Blames Data Breach on Zero-Day as Ransomware Gang Threatens Firm
- New York Man Arrested for Running BreachForums Cybercrime Website
- Exploitation of Recent Fortinet Zero-Day Linked to Chinese Cyberspies
- Mozilla Patches High-Severity Vulnerabilities With Release of Firefox 111
- Microsoft: 17 European Nations Targeted by Russia in 2023 as Espionage Ramping Up
Latest News
- Verosint Launches Account Fraud Detection and Prevention Platform
- Ransomware Gang Publishes Data Allegedly Stolen From Maritime Firm Royal Dirkzwager
- Zoom Paid Out $3.9 Million in Bug Bounties in 2022
- Oleria Scores $8M Seed Funding for ID Authentication Technology
- Exploitation of 55 Zero-Day Vulnerabilities Came to Light in 2022: Mandiant
- News Analysis: UK Commits $3 Billion to Support National Quantum Strategy
- Malicious NuGet Packages Used to Target .NET Developers
- Google Pixel Vulnerability Allows Recovery of Cropped Screenshots
