# Square Thumbnails <= 2.4.0 - Authenticated (Author+) Limited Arbitrary File Deletion via Square Thumbnail Cleanup

- **ID:** WPSEC-2026-3758
- **Plugin:** Square Thumbnails – Square Product Images Without Cropping (`square-thumbnails`), https://wordpress.org/plugins/square-thumbnails/
- **Affected versions:** from 2.3.5 before 2.5
- **Fixed in:** 2.5 (Update to 2.5 or later.)
- **Severity:** Medium 5.4 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L)
- **Weakness:** CWE-706
- **Usage among sites WPSec scans:** plugin Low, affected versions None seen (as of 2026-11-24)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/square-thumbnails
- **Fix released:** 2026-11-23
- **Published:** 2026-11-24
- **URL:** https://wpsec.com/vuln/WPSEC-2026-3758/

## Description

The Square Thumbnails plugin for WordPress is vulnerable to limited arbitrary file deletion via the attachment deletion cleanup routine in all versions up to, and including, 2.4.0, due to the cleanup_on_attachment_delete() function deleting every file matched by broad glob patterns (such as '<name>*-sqt.*' and '<name>-[0-9]*x[0-9]*.*') built from the deleted attachment's file name, without checking whether the matched files belong to other attachments. This makes it possible for authenticated attackers, with Author-level access and above, to upload and then delete an image with a chosen file name, causing thumbnail and square image files of other users' attachments in the same uploads folder to be deleted.

## References

- https://wpsec.com/vuln/WPSEC-2026-3758/
- https://plugins.svn.wordpress.org/square-thumbnails/tags/2.5/
- https://wordpress.org/plugins/square-thumbnails/

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

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.
