# Image Optimizer <= 1.7.7 - Authenticated (Author+) Arbitrary File Deletion via Attachment Backup Metadata

- **ID:** WPSEC-2026-3358
- **Plugin:** Image Optimizer – Compress Images and Convert to WebP or AVIF (`image-optimization`), https://wordpress.org/plugins/image-optimization/
- **Affected versions:** all versions before 1.7.8
- **Fixed in:** 1.7.8 (Update to 1.7.8 or later.)
- **Severity:** High 8.1 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H)
- **Weakness:** CWE-22
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-11-18)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/image-optimization
- **Fix released:** 2026-11-17
- **Published:** 2026-11-18
- **URL:** https://wpsec.com/vuln/WPSEC-2026-3358/

## Description

The Image Optimizer plugin for WordPress is vulnerable to Arbitrary File Deletion via the 'image_optimizer_metadata' attachment backup metadata in all versions up to, and including, 1.7.7. This is due to two gaps: the meta key was not registered as protected, so it could be set through interfaces such as XML-RPC custom fields, and the backup path validator only checked that a stored backup path was inside the uploads directory, not that it belonged to the attachment being processed. This makes it possible for authenticated attackers, with Author-level access and above, to point a backup path on one of their own attachments at any file under the uploads directory, such as other users' media or files other plugins keep there, and have that file deleted when the plugin cleans up backups, for example when the attacker deletes the attachment.

## References

- https://wpsec.com/vuln/WPSEC-2026-3358/
- https://plugins.svn.wordpress.org/image-optimization/tags/1.7.8/
- https://wordpress.org/plugins/image-optimization/

Source: WPSec, https://wpsec.com/vuln/WPSEC-2026-3358/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Free to use, share and adapt, also commercially, if you credit WPSec and link to this advisory.
