Atomic Edge analysis of CVE-2026-7311:
This vulnerability affects the TinyPNG plugin for WordPress versions up to and including 3.6.13. It allows authenticated attackers with Author-level access or higher to delete arbitrary files on the server. The vulnerability carries a CVSS score of 8.1 and is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).
Root Cause:
The root cause lies in the `delete_converted_image_size()` function in `src/class-tiny-image-size.php` (lines 240-247). This function calls `unlink()` on `$this->meta[‘convert’][‘path’]` without validating that the path resides within the WordPress uploads directory. The path value comes from the `tiny_compress_images` post meta, which an attacker can control by editing the post meta on an attachment they own (Author-level access grants this capability). The vulnerable code path triggers when an attachment with specially crafted post meta is deleted.
Exploitation:
An authenticated attacker with Author-level privileges crafts a request to modify the `tiny_compress_images` post meta on an attachment they control. They set the `convert.path` field to an arbitrary server file path, such as `/var/www/html/wp-config.php`. The attacker then deletes the attachment via the WordPress media deletion functionality (e.g., `wp_ajax_delete-post`). The `delete_converted_image_size()` function is invoked during attachment deletion, executing `unlink()` on the attacker-controlled path without proper validation.
Patch Analysis:
The patch in version 3.6.14 introduces a validation check in `delete_converted_image_size()`. It obtains the real path of the conversion target using `realpath()` and compares it against the real path of the WordPress uploads base directory. It uses a new helper function `Tiny_Helpers::str_starts_with()` to verify that the converted file path begins with the uploads directory path. If the path does not start within the uploads directory, `unlink()` is not called. This prevents attackers from deleting files outside the uploads directory.
Impact:
Successful exploitation allows an attacker to delete arbitrary files on the server, including critical files like `wp-config.php`. Deleting `wp-config.php` forces WordPress into its installation routine, potentially leading to remote code execution if the attacker can then access the installation wizard and configure the site under their control. The attack can also delete other sensitive files, causing denial of service or privilege escalation.







