CVE-2026-135650 in Optimole Plugin
Summary
by MITRE • 11/26/2026
The Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'author' parameter in all versions up to, and including, 4.2.20 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. This vulnerability is only reachable when the plugin's 'Enable generic placeholder color' option is disabled, as only that configuration invokes the build_url() code path that constructs $low_url from attacker-controlled input.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/27/2026
The Optimole WordPress plugin, widely utilized for image optimization and content delivery network integration, contains a critical stored cross-site scripting vulnerability in versions up to 4.2.20. This flaw stems from insufficient input sanitization and output escaping mechanisms within the application logic that handles user-provided data. Specifically, the vulnerability resides in the processing of the author parameter during URL construction operations. When an attacker successfully injects malicious script payloads into this field, these scripts are stored on the server-side database rather than being executed immediately upon submission. Consequently, the payload persists and is served to legitimate users whenever they access pages containing the compromised content, leading to persistent compromise scenarios that can affect multiple victims over time without further interaction from the attacker.
The technical root cause of this vulnerability lies in a specific code path within the plugin's architecture known as build_url(). This function constructs URLs by incorporating user-supplied input into variables such as low_url without applying adequate security filters or encoding mechanisms before outputting them to the browser environment. Under normal operational conditions, certain configuration settings may prevent this specific code path from being invoked with untrusted data. However, when the plugin setting for Enable generic placeholder color is disabled, the application logic shifts to a different execution branch that directly processes and embeds attacker-controlled input into HTML attributes or script contexts without proper escaping. This conditional availability means that while the vulnerability exists in all versions up to 4.2.20, its exploitability is contingent upon this specific configuration state being active on the target WordPress installation.
From an operational impact perspective, a successful exploitation of this stored cross-site scripting flaw allows unauthenticated attackers to execute arbitrary JavaScript code within the context of the victim's browser session. This capability enables a wide range of malicious activities including but not limited to stealing administrative cookies and authentication tokens, performing actions on behalf of authenticated users such as modifying site settings or publishing content, redirecting users to phishing sites designed to harvest credentials, and defacing web pages by injecting unauthorized visual elements. Because the payload is stored server-side, each visit to an affected page triggers the execution of the malicious script, amplifying the potential blast radius significantly compared to reflected cross-site scripting vulnerabilities which require direct user interaction with a crafted link for every instance of exploitation.
This vulnerability aligns closely with Common Weakness Enumeration identifier CWE-79, which classifies improper neutralization of input during web page generation as Cross-site Scripting. Furthermore, in the context of the MITRE ATT&CK framework, this exploit maps to techniques involving Client-side Injection and potentially Account Manipulation or Credential Access depending on how the injected script is utilized by the attacker. The lack of output escaping represents a fundamental failure in defense-in-depth strategies where input validation alone is insufficient without corresponding output encoding tailored to the specific context such as HTML attributes or JavaScript strings within which the data is rendered.
To mitigate this vulnerability, administrators must immediately update the Optimole plugin to version 4.2.21 or later where these sanitization and escaping issues have been addressed by the developers. Until an upgrade can be performed, temporary mitigation strategies include ensuring that the Enable generic placeholder color option remains enabled if feasible within the site's design requirements, thereby avoiding the vulnerable code path entirely. Additionally implementing a Web Application Firewall with rules capable of detecting and blocking cross-site scripting payloads in POST requests targeting WordPress admin endpoints or REST API interfaces associated with image optimization can provide an additional layer of defense against exploitation attempts by unauthenticated actors seeking to inject malicious scripts into stored content fields.