CVE-2024-34515: image-optimizer allows PHAR deserialization
8.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.35333%
CWE
Published
5/5/2024
Updated
8/21/2024
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| spatie/image-optimizer | composer | < 1.7.3 | 1.7.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from file_exists() being called on attacker-controlled input without protocol validation. PHAR deserialization occurs when PHP processes phar:// URIs through filesystem functions. The pre-patch code in Image.php's constructor directly used file_exists($pathToImage) without sanitizing the protocol, allowing malicious phar:// payloads. The patch adds protocol validation (isProtocolAllowed()) before file_exists() to mitigate this.