CVE-2024-34515 image-optimizer allows PHAR deserialization
Attackers can achieve code execution via PHAR deserialization in the image-optimizer library by exploiting the phar:// protocol in file existence checks.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-34515?
CVE-2024-34515 is a high-severity unsafe deserialization vulnerability in n/a, published on 5 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
image-optimizer before 1.7.3 allows PHAR deserialization, e.g., the phar:// protocol in arguments to file_exists().
Weakness: CWE-502
Which versions are affected by CVE-2024-34515?
2 open source packages ship an affected version, including spatie/image-optimizer.
| Package | Affected | Fixed in |
|---|---|---|
spatie/image-optimizer Packagist | All versions | 1.7.3 |
spatie/image-optimizer Packagist | All versions | 1.7.3 |
How do I fix CVE-2024-34515?
Upgrade spatie/image-optimizer to 1.7.3 or later.
Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.
Is CVE-2024-34515 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-34515 exists.
Sources
Also known as CLSA-2026-1793215035, GHSA-6pjm-hmvf-h4rr.