CVE-2025-47946
JSON

6.1medium

symfony/ux-live-component and symfony/ux-twig-component vulnerable to unsanitized HTML attribute injection via ComponentAttributes

Severity
6.1medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.26% (higher than 18% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-5j3w-5pcr-f8hg

Description

Symfony UX is an initiative and set of libraries to integrate JavaScript tools into applications. Prior to version 2.25.1, rendering `{{ attributes }}` or using any method that returns a `ComponentAttributes` instance (e.g. `only()`, `defaults()`, `without()`) ouputs attribute values directly without escaping. If these values are unsafe (e.g. contain user input), this can lead to HTML attribute injection and XSS vulnerabilities. The issue is fixed in version `2.25.1` of `symfony/ux-twig-component` Those who use `symfony/ux-live-component` must also update it to `2.25.1` to benefit from the fix, as it reuses the `ComponentAttributes` class internally. As a workaround, avoid rendering `{{ attributes }}` or derived objects directly if it may contain untrusted values. Instead, use `{{ attributes.render('name') }}` for safe output of individual attributes.

Affected

Product or packageVersionsReported by
symfony ux< 2.25.1CVE List
symfony/ux-twig-component (Packagist)before 2.25.1GitHub Advisory Database
symfony/ux-live-component (Packagist)before 2.25.1GitHub Advisory Database

All scores

GitHub_M6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHub6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Symfony UX is an initiative and set of libraries to integrate JavaScript tools into applications. Prior to version 2.25.1, rendering `{{ attributes }}` or using any method that returns a `ComponentAttributes` instance (e.g. `only()`, `defaults()`, `without()`) ouputs attribute values directly without escaping. If these values are unsafe (e.g. contain user input), this can lead to HTML attribute injection and XSS vulnerabilities. The issue is fixed in version `2.25.1` of `symfony/ux-twig-component` Those who use `symfony/ux-live-component` must also update it to `2.25.1` to benefit from the fix, as it reuses the `ComponentAttributes` class internally. As a workaround, avoid rendering `{{ attributes }}` or derived objects directly if it may contain untrusted values. Instead, use `{{ attributes.render('name') }}` for safe output of individual attributes.

GitHub Advisory Database
Impact

Rendering {{ attributes }} or using any method that returns a ComponentAttributes instance (e.g. only(), defaults(), without()) ouputs attribute values directly without escaping. If these values are unsafe (e.g. contain user input), this can lead to HTML attribute injection and XSS vulnerabilities.

Patches

The issue is fixed in version 2.25.1 of symfony/ux-twig-component by using Twig's EscaperRuntime to properly escape HTML attributes in ComponentAttributes. If you use symfony/ux-live-component, you must also update it to 2.25.1 to benefit from the fix, as it reuses the ComponentAttributes class internally.

Workarounds

Until you can upgrade, avoid rendering {{ attributes }} or derived objects directly if it may contain untrusted values. Instead, use {{ attributes.render('name') }} for safe output of individual attributes.

References

GitHub repository: symfony/ux

NVD (es)

Symfony UX es una iniciativa y un conjunto de librerías para integrar herramientas de JavaScript en aplicaciones. Antes de la versión 2.25.1, renderizar `{{ atributos }}` o usar cualquier método que devuelva una instancia de `ComponentAttributes` (por ejemplo, `only()`, `defaults()`, `without()`) genera valores de atributos directamente sin escapar. Si estos valores no son seguros (por ejemplo, contienen entrada del usuario), esto puede llevar a la inyección de atributos HTML y vulnerabilidades XSS. El problema se solucionó en la versión `2.25.1` de `symfony/ux-twig-component` Aquellos que usan `symfony/ux-live-component` también deben actualizarlo a `2.25.1` para beneficiarse de la corrección, ya que reutiliza la clase `ComponentAttributes` internamente. Como workaround, evite renderizar `{{ atributos }}` u objetos derivados directamente si puede contener valores no confiables. En su lugar, utilice `{{attributes.render('name') }}` para una salida segura de atributos individuales.

References

https://github.com/symfony/ux/security/advisories/GHSA-5j3w-5pcr-f8hgweb
https://github.com/symfony/ux/commit/b5d1c85995c128cb926d47a96cfbfbd500b643a8web
https://nvd.nist.gov/vuln/detail/CVE-2025-47946advisory
https://github.com/symfony/ux-live-component/commit/7ad44cf56d750b9f56658ed986286a10da132ee7web
https://github.com/symfony/ux-twig-component/commit/b5d4e77db69315aeb18d2238e0e7c943d340ce76web
https://github.com/symfony/ux/commit/c2f7738ee0969c31df7514025a7f5fc6e153932dweb
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/ux-live-component/CVE-2025-47946.yamlweb
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/ux-twig-component/CVE-2025-47946.yamlweb
https://github.com/symfony/uxpackage
https://symfony.com/blog/symfony-ux-cve-2025-47946-unsanitized-html-attribute-injection-via-componentattributesweb

Sources

SourceRecordLicence
CVE ListCVE-2025-47946 changed 2025-05-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-5j3w-5pcr-f8hg changed 2025-08-29CC-BY-4.0
NVDCVE-2025-47946 changed 2026-06-17Public domain