CVE-2026-4335
Received Received - Intake
Stored XSS in ShortPixel WordPress Plugin Allows Authenticated Script Injection

Publication date: 2026-03-26

Last updated on: 2026-03-26

Assigner: Wordfence

Description
The ShortPixel Image Optimizer plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the attachment post_title in all versions up to, and including, 6.4.3. This is due to insufficient output escaping in the getEditorPopup() function and its corresponding media-popup.php template. Specifically, the attachment's post_title is retrieved from the database via get_post() in AjaxController.php (line 435) and passed directly to the view template (line 449), where it is rendered into an HTML input element's value attribute without esc_attr() escaping (media-popup.php line 139). Since WordPress allows Authors to set arbitrary attachment titles (including double-quote characters) via the REST API, a malicious author can craft an attachment title that breaks out of the HTML attribute and injects arbitrary JavaScript event handlers. This makes it possible for authenticated attackers, with Author-level access and above, to inject arbitrary web scripts that execute whenever a higher-privileged user (such as an administrator) opens the ShortPixel AI editor popup (Background Removal or Image Upscale) for the poisoned attachment.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-26
Last Modified
2026-03-26
Generated
2026-05-07
AI Q&A
2026-03-26
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
shortpixel shortpixel_image_optimiser to 6.4.3 (inc)
shortpixel shortpixel_image_optimiser 6.4.4
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-4335 is a Stored Cross-Site Scripting (XSS) vulnerability in the ShortPixel Image Optimizer plugin for WordPress, affecting all versions up to and including 6.4.3.

The vulnerability arises because the plugin does not properly escape the attachment's post_title when rendering it into an HTML input element's value attribute in the media-popup.php template. Specifically, the post_title is retrieved from the database and passed directly to the view without using esc_attr() escaping.

Since WordPress allows Authors to set arbitrary attachment titles, including special characters like double quotes, a malicious author-level user can craft a post_title that breaks out of the HTML attribute and injects arbitrary JavaScript event handlers.

This enables authenticated attackers with Author-level access or higher to inject malicious scripts that execute when a higher-privileged user (such as an administrator) opens the ShortPixel AI editor popup (for background removal or image upscale) for the compromised attachment.


How can this vulnerability impact me? :

This vulnerability can lead to the execution of arbitrary JavaScript code in the context of a higher-privileged user’s browser session.

An attacker with Author-level access can inject malicious scripts that run when an administrator or other privileged user opens the AI editor popup for the poisoned attachment.

Potential impacts include theft of sensitive information, session hijacking, unauthorized actions performed on behalf of the administrator, or further compromise of the WordPress site.

Because the vulnerability requires at least Author-level access, it is a privilege escalation vector that can be exploited within the site by authenticated users.


What immediate steps should I take to mitigate this vulnerability?

The vulnerability CVE-2026-4335 affects the ShortPixel Image Optimiser WordPress plugin in all versions up to and including 6.4.3. It allows authenticated users with Author-level access or higher to perform stored Cross-Site Scripting (XSS) attacks by injecting malicious scripts into attachment titles.

To mitigate this vulnerability immediately, you should update the ShortPixel Image Optimiser plugin to version 6.4.4 or later, where the issue has been fixed. The update includes security patches that address the stored XSS vulnerability and other related security issues.

Additionally, ensure that only trusted users have Author-level or higher permissions on your WordPress site, as the vulnerability requires authenticated access with such privileges.

If updating immediately is not possible, consider temporarily restricting or auditing user roles and permissions to prevent untrusted users from exploiting this vulnerability.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability in the ShortPixel Image Optimiser plugin allows authenticated users with Author-level access or higher to inject arbitrary JavaScript via stored cross-site scripting (XSS). This can lead to unauthorized script execution when higher-privileged users interact with the poisoned attachment.

Such a vulnerability could potentially lead to unauthorized access to sensitive information or manipulation of user sessions, which may impact compliance with data protection regulations like GDPR or HIPAA that require safeguarding personal data and preventing unauthorized access.

However, the provided context and resources do not explicitly discuss or analyze the impact of this vulnerability on compliance with specific standards or regulations.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

The vulnerability CVE-2026-4335 affects the ShortPixel Image Optimiser WordPress plugin versions up to and including 6.4.3. It is a stored Cross-Site Scripting (XSS) vulnerability exploitable by authenticated users with Author-level access or higher. Detection involves identifying if your WordPress installation uses the vulnerable plugin version and if any attachment post titles have been manipulated to include malicious scripts.

Since the vulnerability involves injection of malicious JavaScript into the attachment post_title field, detection can focus on scanning the WordPress database for suspicious or unexpected script tags or event handlers in attachment titles.

Suggested detection steps and commands include:

  • Check the installed version of the ShortPixel Image Optimiser plugin to confirm if it is version 6.4.3 or earlier (vulnerable versions).
  • Query the WordPress database to find attachment post titles containing suspicious characters such as double quotes, script tags, or JavaScript event handlers that could indicate an XSS payload.
  • Example SQL command to detect suspicious post titles in the WordPress database (replace 'wp_' with your database prefix):
  • SELECT ID, post_title FROM wp_posts WHERE post_type = 'attachment' AND post_title LIKE '%"%' OR post_title LIKE '%<script%' OR post_title LIKE '%onerror=%' OR post_title LIKE '%onclick=%';

Additionally, monitoring HTTP requests to the AJAX endpoints of the ShortPixel plugin (such as those handled by AjaxController.php) for unusual or unauthorized access patterns by users with Author or Editor roles may help detect exploitation attempts.

Since the vulnerability requires authenticated users with Author-level access or higher, reviewing user roles and recent changes to media attachment titles can also assist in detection.

Ultimately, the best mitigation and detection is to update the plugin to version 6.4.4 or later, where the vulnerability is patched.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart