Image Optimizer <= 1.7.4 - Authenticated (Author+) Arbitrary File Deletion via Post Meta Field Injection
Strategic Overview
- Status
- Patched in 1.7.5
- Affected Version
<= 1.7.4- CVSS
- 8.1High
- Weakness type
- CWE-73 · External Control of File Name or Path
- CVE
CVE-2026-5821
At a glance
CVE-2026-5821 is a high-severity External Control of File Name or Path vulnerability in the Image Optimization WordPress plugin, affecting versions <= 1.7.4. It carries a CVSS score of 8.1 (reachable over the network; low attack complexity; high integrity, availability impact). Exploitation requires an authenticated account at Author level or above. The issue is fixed in version 1.7.5; sites on affected versions should update now. Disclosed July 2026, reported by Dmitrii Ignatyev.
Vulnerability Overview
The Image Optimizer plugin for WordPress is vulnerable to arbitrary file deletion in versions up to and including 1.7.4. This is due to insufficient path validation in the Image_Backup::remove() function where backup file paths stored in post meta are used directly in file deletion operations without verifying they are within the uploads directory. The plugin stores backup file paths in the image_optimizer_metadata post meta field and trusts these paths completely when deleting backups on the delete_attachment hook. An authenticated attacker with Author-level access can edit the image_optimizer_metadata post meta on their own attachments via WordPress's Custom Fields interface, injecting arbitrary absolute file paths into the backups array. When the attacker subsequently deletes the attachment, the plugin calls File_System::delete() on each path without validation. This makes it possible for authenticated attackers, with Author-level access and above, to delete arbitrary files on the server within the web server's filesystem permissions, potentially leading to denial of service, data loss, or security degradation.
Technical Analysis
The vector marks this flaw as remotely reachable over the network, with low attack complexity — no special timing or configuration is needed, and no interaction from a victim user. A successful exploit has high impact on integrity, availability.
CWE-73: External Control of File Name or Path
The product allows user input to control or influence paths or file names that are used in filesystem operations.
Remediation
Update to version 1.7.5, or a newer patched version
How does WordSec protect against this?
An attacker needs Author access first, so the firewall sees the attempt as traffic from a logged-in account: WordSec's web application firewall inspects request payloads before WordPress loads them. Classes like this one can leave something behind, so the staged malware scanner is the second half: it looks for dropped files and modified code rather than for the request that created them. None of that substitutes for the fix: Image Optimization 1.7.5 closes this, and updating the plugin is the step that ends it.
- Firewall
- Scanner
- Alerts
External References
Related records
Other vulnerabilities in Image Optimization – Compress Images and Convert to WebP or AVIF
Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C