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

Published Jun 19, 2026
·
Updated

Description

The uxicon() Twig function is marked issafe=['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.

Other sources

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 uxicon() Twig function is marked issafe=['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.

MITRE

Affected Software

4 affected componentsFixes available
composer/symfony/ux-icons>=3.0.0<3.2.0
3.2.0
composer/symfony/ux-icons>=2.17.0<2.36.1
2.36.1
Symfony UX>=2.17.0<2.36.1
Symfony UX>=3.0.0<3.2.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/symfony/ux-icons to a version that resolves this vulnerability.

    Fixed in 3.2.0
  2. Upgrade

    Upgrade composer/symfony/ux-icons to a version that resolves this vulnerability.

    Fixed in 2.36.1
  3. Upgrade

    Upgrade symfony/ux-icons to a version that resolves this vulnerability.

    Fixed in 2.36.1
  4. Upgrade

    Upgrade symfony/ux-icons to a version that resolves this vulnerability.

    Fixed in 3.2.0
  5. Configuration

    Update Symfony UX Icons so ux_icon() is no longer marked is_safe=['html'], allowing Twig to escape/safely handle the rendered SVG output after sanitization.

    Symfony UX Icons Twig function ux_icon() is_safe=['html'] = remove/adjust (stop marking as safe html)
  6. Configuration

    Ensure a centralized IconFactory sanitizes SVG content across all icon sources before creating the Icon object, and that Icon::toHtml() no longer inlines SVG source verbatim without sanitization (sanitizer must remove script-capable elements and all on* attributes, and strip dangerous URL schemes: javascript:, vbscript:, data:text/html).

    Symfony UX Icons IconFactory / Icon::toHtml() rendering SVG sanitization before inlining = enabled

Event History

Jun 19, 2026
Advisory Published
via GitHub·09:42 PM
Data Sourced
via GitHub·09:42 PM
DescriptionSeverityWeaknessAffected Software
Jul 8, 2026
CVE Published
via MITRE·09:32 PM
Data Sourced
via MITRE·09:32 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:17 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-55877?

The severity of CVE-2026-55877 is ranked as medium with a score of 6.1.

2

What are the main risks associated with CVE-2026-55877?

The main risks associated with CVE-2026-55877 are related to cross-site scripting (XSS) vulnerabilities due to unsanitized SVG icons.

3

How do I fix CVE-2026-55877?

To fix CVE-2026-55877, ensure that SVG sources are properly sanitized before rendering them with the ux_icon() function.

4

What software is affected by CVE-2026-55877?

CVE-2026-55877 affects the Symfony UX Icons package.

5

Is CVE-2026-55877 an XSS vulnerability?

Yes, CVE-2026-55877 is classified as an XSS vulnerability due to the potential execution of scripts in inline SVG.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203