# EWWW Image Optimizer <= 8.9.2 - Authenticated (Contributor+) Stored Cross-Site Scripting via Image Attribute Rewriting

- **ID:** WPSEC-2026-4567
- **Plugin:** EWWW Image Optimizer (`ewww-image-optimizer`), https://wordpress.org/plugins/ewww-image-optimizer/
- **Affected versions:** all versions before 8.9.3
- **Fixed in:** 8.9.3 (Update to 8.9.3 or later.)
- **Severity:** Medium 4.9 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N)
- **Weakness:** CWE-79
- **Usage among sites WPSec scans:** plugin High, affected versions High (as of 2026-12-03)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/ewww-image-optimizer
- **Fix released:** 2026-12-02
- **Published:** 2026-12-03
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4567/

## Description

The EWWW Image Optimizer plugin for WordPress is vulnerable to Stored Cross-Site Scripting via its front-end HTML attribute rewriting (used by Lazy Load, JS WebP and Picture WebP delivery) in all versions up to, and including, 8.9.2. This is due to the plugin updating an attribute by replacing every occurrence of the attribute's original text in the tag. When the same text also appears inside another attribute's value, such as an alt attribute, it is rewritten there as well with double quotes, which breaks out of the enclosing attribute. This makes it possible for authenticated attackers, with contributor-level access and above, to craft image markup in post content that executes arbitrary web scripts when a user views the page, provided one of these front-end features is enabled.

## References

- https://wpsec.com/vuln/WPSEC-2026-4567/
- https://plugins.svn.wordpress.org/ewww-image-optimizer/tags/8.9.3/
- https://wordpress.org/plugins/ewww-image-optimizer/

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

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.
