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 package | Versions | Reported by |
|---|---|---|
| symfony ux | < 2.25.1 | CVE List |
| symfony/ux-twig-component (Packagist) | before 2.25.1 | GitHub Advisory Database |
| symfony/ux-live-component (Packagist) | before 2.25.1 | GitHub Advisory Database |
All scores
| GitHub_M | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-47946 changed 2025-05-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5j3w-5pcr-f8hg changed 2025-08-29 | CC-BY-4.0 |
| NVD | CVE-2025-47946 changed 2026-06-17 | Public domain |