# Optimole <= 4.2.17 - Authenticated (Contributor+) Stored Cross-Site Scripting via JSON-Escaped Image URLs

- **ID:** WPSEC-2026-2435
- **Plugin:** Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization (`optimole-wp`), https://wordpress.org/plugins/optimole-wp/
- **Affected versions:** all versions before 4.2.18
- **Fixed in:** 4.2.18 (Update to 4.2.18 or later.)
- **Severity:** Medium 6.4 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N)
- **Weakness:** CWE-79
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-11-04)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/optimole-wp
- **Fix released:** 2026-11-02
- **Published:** 2026-11-03
- **URL:** https://wpsec.com/vuln/WPSEC-2026-2435/

## Description

The Optimole plugin for WordPress is vulnerable to Stored Cross-Site Scripting via JSON-escaped (slashed) image URLs in all versions up to, and including, 4.2.17, due to insufficient input sanitization and output escaping. When the plugin rewrites image tags, it decodes \uXXXX escapes and HTML entities in slashed image source URLs and writes parts of the decoded value back into the tag without escaping, including the filename segment of offloaded image URLs. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

## References

- https://wpsec.com/vuln/WPSEC-2026-2435/
- https://plugins.svn.wordpress.org/optimole-wp/tags/4.2.18/
- https://wordpress.org/plugins/optimole-wp/

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

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.
