Symfony UX Icons CVE-2026-55877
MEDIUMSeverity by source
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Iconify path is network-reachable with no auth required; victim must load the page (UI:R); SVG inline execution crosses to browser origin (S:C); no availability impact.
Primary rating from Vendor (https://github.com/symfony/ux).
CVSS VectorVendor: https://github.com/symfony/ux
Lifecycle Timeline
2DescriptionCVE.org
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.
AnalysisAI
Cross-site scripting in Symfony UX Icons (symfony/ux-icons) allows an attacker who controls SVG icon content - via a malicious third-party icon pack, a downloaded icon set, or a tampered Iconify on-demand endpoint - to inject and execute arbitrary JavaScript in the browsers of users who load any page rendering those icons. Two distinct sanitization failures existed: the local-file path in Icon::fromFile() only stripped top-level <script> children of <svg>, ignoring nested scripts and all on* event-handler attributes, while the Iconify on-demand path (enabled by default) applied zero sanitization to the remote JSON body field before inlining it as HTML. No public exploit code has been identified at time of analysis, and this CVE does not appear in the CISA KEV catalog.
Technical ContextAI
Symfony UX Icons (composer package symfony/ux-icons) provides a ux_icon() Twig helper that renders SVG icons inline into HTML pages. Because the function is declared is_safe=['html'], Twig's auto-escaping is intentionally suppressed, delegating all sanitization responsibility to the component itself. Icon::toHtml() writes raw SVG markup verbatim into the document. Browsers execute <script> elements and on* event-handler attributes inside inline SVG, making any unescaped attacker-supplied SVG a CWE-79 (Improper Neutralization of Input During Web Page Generation) vector. The CPE affected packages are pkg:composer/symfony_ux-icons in the 2.17.0-2.36.0 and 3.0.0-3.1.x ranges. The Iconify on-demand code path, which fetches icon data from a configurable remote endpoint (iconify.endpoint) and is active by default, represented the most permissive attack surface because no filtering whatsoever was applied to the fetched JSON body before object construction.
RemediationAI
Upgrade symfony/ux-icons to version 2.36.1 (for the 2.x branch) or 3.2.0 (for the 3.x branch); both versions introduce the new IconFactory class that centralizes sanitization for every icon source before an Icon object is constructed. The sanitizer removes script, foreignObject, iframe, object, and embed elements; strips SMIL animations targeting on*, href, or xlink:href attributes; removes CDATA sections and processing instructions; eliminates all on* event-handler attributes; and blocks javascript:, vbscript:, and data:text/html URL schemes. If an immediate upgrade is not possible, the most effective compensating control is to disable the Iconify on-demand feature entirely by removing or nullifying the iconify.endpoint configuration, since that code path applied no sanitization at all. Additionally, audit all third-party SVG icon packs and downloaded icon sets for script-capable constructs before deployment. Note that disabling the Iconify on-demand path removes the ability to fetch icons dynamically at runtime. Advisory details are available at https://github.com/symfony/ux/security/advisories/GHSA-6v8j-33hc-mv84.
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-6v8j-33hc-mv84