CVE-2026-55877
JSON

6.1medium

Symfony UX: XSS in symfony/ux-icons via unsanitized SVG content in local files and Iconify on-demand responses

Severity
6.1medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.34% (higher than 28% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-6v8j-33hc-mv84

Description

Symfony UX is a JavaScript ecosystem for Symfony. From 2.17.0 before 2.36.1 and from 3.0.0 before 3.2.0, the ux_icon() Twig function is marked is_safe=['html'] and Icon::toHtml() inlines SVG source verbatim, allowing unsanitized local SVG files or Iconify on-demand JSON body responses containing nested script elements, on* event handlers, or dangerous URL schemes to execute cross-site scripting. This issue is fixed in versions 2.36.1 and 3.2.0.

Affected

Product or packageVersionsReported by
symfony ux>= 2.17.0, < 2.36.1, >= 3.0.0, < 3.2.0, from 2.17.0 before 2.36.1, from 3.0.0 before 3.2.0CVE List, NVD
symfony/ux-icons (Packagist)from 2.17.0 before 2.36.1, from 3.0.0 before 3.2.0GitHub 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 a JavaScript ecosystem for Symfony. From 2.17.0 before 2.36.1 and from 3.0.0 before 3.2.0, the ux_icon() Twig function is marked is_safe=['html'] and Icon::toHtml() inlines SVG source verbatim, allowing unsanitized local SVG files or Iconify on-demand JSON body responses containing nested script elements, on* event handlers, or dangerous URL schemes to execute cross-site scripting. This issue is fixed in versions 2.36.1 and 3.2.0.

GitHub Advisory Database
Description

The ux_icon() Twig function is marked is_safe=['html'], so Twig never escapes its output. Icon::toHtml() inlines the SVG source verbatim into the page. Browsers execute <script> elements and on* event-handler attributes found inside inline SVG, making any unsanitized icon a vector for cross-site scripting.

Two code paths were affected. In the local file path, Icon::fromFile() only stripped <script> elements that were direct children of <svg>, leaving nested scripts and all on* attributes untouched despite a code comment claiming broader protection. In the Iconify on-demand path (enabled by default), the remote JSON body field was wrapped into an Icon object with no sanitization at all. Concrete attack vectors include a malicious SVG icon pack from a third-party theme or downloaded icon set, or a controlled Iconify endpoint configured via iconify.endpoint (including a poisoned cache).

Resolution

Introducing an IconFactory that centralizes sanitization across every icon source before an Icon object is created. The sanitizer removes script-capable elements (script, foreignObject, iframe, object, embed), SMIL animations targeting on*, href, or xlink:href attributes, CDATA sections, processing instructions, all on* attributes, and javascript:, vbscript:, and data:text/html URL schemes. <style> elements are kept for theming but have any handlers stripped. Icons that contain none of these constructs are byte-for-byte identical after sanitization.

Credits

Symfony would like to thank Pascal Cescon for reporting the issue and Hugo Alliaume for providing the fix.

NVD (es)

Symfony UX es un ecosistema JavaScript para Symfony. Desde 2.17.0 antes de 2.36.1 y desde 3.0.0 antes de 3.2.0, la función Twig ux_icon() está marcada como is_safe=[’html’] e Icon::toHtml() inserta el código fuente SVG textualmente, permitiendo que archivos SVG locales no saneados o respuestas de cuerpo JSON bajo demanda de Iconify que contengan elementos de script anidados, manejadores de eventos on, o esquemas de URL peligrosos ejecuten cross-site scripting. Este problema está solucionado en las versiones 2.36.1 y 3.2.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-55877 changed 2026-07-09CVE Terms of Use
GitHub Advisory DatabaseGHSA-6v8j-33hc-mv84 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-55877 changed 2026-10-25Public domain