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

CVE-2026-2430

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 lazy-loading image processing in all versions up to, and including, 3.1.14. This is due to the use of an overly permissive regular expression in the `add_lazyload` function that replaces all occurrences of `\ssrc=` in image tags without limiting to the actual attribute. 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 by crafting an image tag where the `src` URL contains a space followed by `src=`, causing the regex to break the HTML structure and promote text inside attribute values into executable HTML attributes.

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
<!-- PoC Concept: Author: Security Researcher Description: Inject a malicious image tag that breaks the HTML structure via the vulnerable regex. --> <img src="https://attacker.com/image.jpg src=" onerror="alert('CVE-2026-2430_PoC')" width="100">

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-2430", "sourceIdentifier": "[email protected]", "published": "2026-03-21T00:16:26.053", "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 lazy-loading image processing in all versions up to, and including, 3.1.14. This is due to the use of an overly permissive regular expression in the `add_lazyload` function that replaces all occurrences of `\\ssrc=` in image tags without limiting to the actual attribute. 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 by crafting an image tag where the `src` URL contains a space followed by `src=`, causing the regex to break the HTML structure and promote text inside attribute values into executable HTML attributes."}, {"lang": "es", "value": "El plugin Autoptimize para WordPress es vulnerable a cross-site scripting almacenado a través del procesamiento de imágenes de carga diferida en todas las versiones hasta la 3.1.14, inclusive. Esto se debe al uso de una expresión regular excesivamente permisiva en la función `add_lazyload` que reemplaza todas las ocurrencias de `\\ssrc=` en las etiquetas de imagen sin limitarse al atributo real. Esto hace posible que atacantes autenticados, con acceso de nivel Colaborador y superior, inyecten scripts web arbitrarios en páginas que se ejecutarán cada vez que un usuario acceda a una página inyectada al crear una etiqueta de imagen donde la URL `src` contiene un espacio seguido de `src=`, lo que hace que la expresión regular rompa la estructura HTML y promueva texto dentro de los valores de los atributos a atributos HTML ejecutables."}], "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/a0f87112fe80b5a97b036229c41cb18454392858", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/autoptimize/tags/3.1.14/classes/autoptimizeImages.php#L987", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/autoptimize/trunk/classes/autoptimizeImages.php#L987", "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/ddc5c4d7-09dc-45bf-a3c7-5a0757e3110a?source=cve", "source": "[email protected]"}]}}