Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
7.2
Optimole WordPress Plugin Allows Attackers to Inject Malware on Any Page
CVE-2026-5217
Summary
The Optimole plugin for WordPress contains a security flaw that allows hackers to inject malicious code on any page, even if they're not logged in. This can happen when a user visits a page that has been compromised. To stay secure, update the plugin to the latest version, which fixes this issue.
Original title
The Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization plugin for WordPress is vulnerable to Stored Cross-Site Scripting in all versions up to, and including, 4...
Original description
The Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization plugin for WordPress is vulnerable to Stored Cross-Site Scripting in all versions up to, and including, 4.2.2. This is due to insufficient input sanitization and output escaping on the user-supplied 's' parameter (srcset descriptor) in the unauthenticated /wp-json/optimole/v1/optimizations REST endpoint. The endpoint validates requests using an HMAC signature and timestamp, but these values are exposed directly in the frontend HTML making them accessible to any visitor. The plugin uses sanitize_text_field() on the descriptor value of rest.php, which strips HTML tags but does not escape double quotes. The poisoned descriptor is then stored via transients (backed by the WordPress options table) and later retrieved and injected verbatim into the srcset attribute of tag_replacer.php without proper escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts into pages that will execute whenever a user accesses the injected page.
nvd CVSS3.1
7.2
Vulnerability type
CWE-79
Cross-site Scripting (XSS)
- https://plugins.trac.wordpress.org/browser/optimole-wp/tags/4.2.1/inc/rest.php#L...
- https://plugins.trac.wordpress.org/browser/optimole-wp/tags/4.2.1/inc/rest.php#L...
- https://plugins.trac.wordpress.org/browser/optimole-wp/tags/4.2.1/inc/tag_replac...
- https://plugins.trac.wordpress.org/browser/optimole-wp/trunk/inc/rest.php#L1008
- https://plugins.trac.wordpress.org/browser/optimole-wp/trunk/inc/rest.php#L159
- https://plugins.trac.wordpress.org/browser/optimole-wp/trunk/inc/tag_replacer.ph...
- https://www.wordfence.com/threat-intel/vulnerabilities/id/50417068-339a-4ae5-9c9...
Published: 11 Apr 2026 · Updated: 11 Apr 2026 · First seen: 11 Apr 2026