# CVE-2026-5821: Elemntor Image Optimizer arbitrary file deletion in Image_Backup::remove

Source: https://junglewise.ai/threats/cve-2026-5821-elemntor-image-optimizer-arbitrary-file-deletion-in-image-backup  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-02. Updated: 2026-07-02  
License: CC BY 4.0 with a link back

CVE-2026-5821 · Severity: high · CVSS 8.1 · Published 2026-07-02

The Image Optimizer plugin for WordPress, used to compress images and improve website speed, contains a security flaw that allows certain users to delete critical files from the web server. An attacker with Author-level access or higher can manipulate image metadata to target specific files for deletion when they remove an image attachment. This could lead to a complete website shutdown, loss of important data, or the removal of security configurations.

Vendors: [Elementor](https://junglewise.ai/threats/vendors/elementor).

## Quick answers

**Is CVE-2026-5821 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-5821 being exploited in the wild.

**How severe is CVE-2026-5821?** High severity, with a CVSS score of 8.1, published 2 July 2026.

**Which products and versions are affected?** Elementor Image Optimizer – Optimize Images and Convert to WebP or AVIF up to and including 1.7.4.

**Is there a fix for CVE-2026-5821?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-5821 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-5821?** Check whether you run Elementor Image Optimizer – Optimize Images and Convert to WebP or AVIF at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

This vulnerability is classified as an arbitrary file deletion (CWE-73) resulting from insufficient path validation in the Image_Backup::remove() function. The plugin fails to verify that backup file paths stored in the 'image_optimizer_metadata' post meta field are restricted to the intended uploads directory. An authenticated attacker with Author-level permissions can use the WordPress Custom Fields interface to modify this metadata on their own attachments, injecting arbitrary absolute file paths. When the attacker deletes the attachment, the 'delete_attachment' hook triggers File_System::delete() on the attacker-supplied paths. This allows for the deletion of any file the web server has permissions to access, potentially causing a Denial of Service (DoS) or bypassing security controls by removing configuration files.

## Affected products

- elemntor Image Optimizer – Optimize Images and Convert to WebP or AVIF up to and including 1.7.4

## Timeline

- 2026-07-02: advisory: NVD publication date
- 2026-07-02: disclosed: Wordfence disclosure date

## References

- [https://plugins.trac.wordpress.org/browser/image-optimization/tags/1.7.3/classes/image/image-backup.php](https://plugins.trac.wordpress.org/browser/image-optimization/tags/1.7.3/classes/image/image-backup.php)
- [https://plugins.trac.wordpress.org/browser/image-optimization/tags/1.7.3/classes/image/image-meta.php](https://plugins.trac.wordpress.org/browser/image-optimization/tags/1.7.3/classes/image/image-meta.php)
- [https://plugins.trac.wordpress.org/browser/image-optimization/tags/1.7.3/modules/backups/components/handle-backups-removing.php](https://plugins.trac.wordpress.org/browser/image-optimization/tags/1.7.3/modules/backups/components/handle-backups-removing.php)
- [https://plugins.trac.wordpress.org/browser/image-optimization/trunk/classes/image/image-backup.php](https://plugins.trac.wordpress.org/browser/image-optimization/trunk/classes/image/image-backup.php)
- [https://plugins.trac.wordpress.org/browser/image-optimization/trunk/classes/image/image-meta.php](https://plugins.trac.wordpress.org/browser/image-optimization/trunk/classes/image/image-meta.php)
- [https://plugins.trac.wordpress.org/browser/image-optimization/trunk/modules/backups/components/handle-backups-removing.php](https://plugins.trac.wordpress.org/browser/image-optimization/trunk/modules/backups/components/handle-backups-removing.php)
- [https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3557772%40image-optimization&new=3557772%40image-optimization&sfp_email=&sfph_mail=](https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3557772%40image-optimization&new=3557772%40image-optimization&sfp_email=&sfph_mail=)
