Loading advisory.
Loading advisory.
OpenMage LTS: Phar Deserialization leads to Remote Code Execution
PHP functions such as getimagesize(), file_exists(), and is_readable() can trigger deserialization when processing phar:// stream wrapper paths. OpenMage LTS uses these functions with potentially controllable file paths during image validation and media handling.
Published 2026-04-20 16:11 UTC · Modified 2026-04-21 14:56 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| openmage/magento-lts | Packagist | < 20.17.0 versions 1.9.1.1, 1.9.2.0, 1.9.2.1, 1.9.2.2, 1.9.2.3, 1.9.2.4, 1.9.3.0, 1.9.3.1, v19.4.0, v19.4.1, v19.4.10, v19.4.11, v19.4.12, v19.4.13, v19.4.14, v19.4.15, v19.4.16, v19.4.17, v19.4.18, v19.4.19 and 70 more | 20.17.0 | composer require 'openmage/magento-lts:>=20.17.0' |
PHP functions such as getimagesize(), file_exists(), and is_readable() can trigger deserialization when processing phar:// stream wrapper paths. OpenMage LTS uses these functions with potentially controllable file paths during image validation and media handling. An attacker who can upload a malicious phar file (disguised as an image) and trigger one of these functions with a phar:// path can achieve arbitrary code execution.
| Metric | Value | Justification | | ------------------------ | --------- | ------------------------------------------------ | | Attack Vector (AV) | Network | Exploitable via file upload and web requests | | Attack Complexity (AC) | High | Requires file upload + triggering phar:// access | | Privileges Required (PR) | None | Some upload vectors don't require authentication | | User Interaction (UI) | None | Exploitation is automatic once triggered | | Scope (S) | Unchanged | Impacts the vulnerable component | | Confidentiality (C) | High | Full system access via RCE | | Integrity (I) | High | Arbitrary code execution | | Availability (A) | High | Complete system compromise possible |
OpenMage LTS versions < 20.16.1
All versions derived from Magento 1.x with these code paths
| File | Line | Vulnerable Function |
| --------------------------------------------------------- | ---- | ---------------------------------------------- |
| app/code/core/Mage/Core/Model/File/Validator/Image.php | 72 | getimagesize($filePath) |
| app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php | 137 | getimagesize($item->getFilename()) |
| lib/Varien/Image.php | 71 | $this->_getAdapter()->open($this->_fileName) |
PHP's phar (PHP Archive) format stores metadata that is serialized. When PHP's stream wrapper functions access a file using the phar:// protocol, the metadata is automatically deserialized. This occurs even with seemingly safe functions like file_exists() or getimagesize().
A polyglot file can be crafted that is both a valid image (passing initial validation) and a valid phar archive containing malicious serialized objects. When the application later processes this file using phar://, the deserialization triggers a gadget chain leading to RCE.
Create polyglot file: Attacker creates a file that is both valid JPEG and valid PHAR
Upload file: Attacker uploads the polyglot via product images, CMS media, or import
Trigger phar:// access: Attacker causes the application to access the file using phar:// wrapper
Code execution: PHAR metadata deserialization triggers gadget chain
<?php
// Create malicious phar file
class ExploitGadget {
public $cmd = 'id > /tmp/pwned';
function __destruct() {
system($this->cmd);
}
}
$phar = new Phar('exploit.phar');
$phar->startBuffering();
$phar->addFromString('test.txt', 'test');
$phar->setStub('<?php __HALT_COMPILER(); ?>');
$phar->setMetadata(new ExploitGadget());
$phar->stopBuffering();
// Rename to appear as image
rename('exploit.phar', 'exploit.jpg');
// When getimagesize('phar://path/to/exploit.jpg') is called,
// the ExploitGadget::__destruct() method executesBlock phar:// paths before passing to vulnerable functions:
// Before (vulnerable)
[$imageWidth, $imageHeight, $fileType] = getimagesize($filePath);
// After (fixed)
if (str_starts_with($filePath, 'phar://')) {
throw new Exception('Invalid image path.');
}
[$imageWidth, $imageHeight, $fileType] = getimagesize($filePath);Additionally, ICO files (which cannot be re-encoded by GD) are now scanned for phar signatures:
__HALT_COMPILER(); - Required phar stub
<?php - PHP opening tag
<?= - PHP short echo tag
Additional hardening measures:
ICO uploads removed: ICO file support is completely removed from new image uploads. This eliminates the polyglot attack vector entirely since all other image formats are re-encoded by GD, which strips any embedded phar metadata.
Phar wrapper disabled: The phar:// stream wrapper is unregistered at application bootstrap, preventing any phar deserialization attacks regardless of code path.
Cache deserialization hardening: All unserialize() calls on cached data now use allowed_classes => false as defense-in-depth.
Note: Existing uploaded ICO files will continue to work. Only new ICO uploads will be rejected. Users are encouraged to use PNG favicons for new uploads.
If immediate upgrade is not possible:
Disable phar stream wrapper (if not needed):
; php.ini
disable_functions = phar://Or in code:
stream_wrapper_unregister('phar');Strict upload validation: Implement additional validation beyond file extension
File storage isolation: Store uploads outside web root with randomized names
Web Application Firewall: Block requests containing phar:// in parameters
This vulnerability was discovered and responsibly disclosed by blackhat2013 through HackerOne.
2025-12-31: Vulnerability reported via HackerOne
2026-01-21: Fix developed and tested
Source: https://hackerone.com/reports/3482926
Exploit code or a detection template for this CVE is published by the sources below. This is not a report of use against real systems (that is what CISA KEV records) and it does not change the tier.
EPSS went from 0.006 on 2026-11-24 to 0.008 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.006 | first score | v2026.06.15 |
| 2026-11-26 | 0.008 | 0.006 | v2026.06.15 |