Medium, CVSS 6.1PackagistPublished
symfony/ux-icons: XSS via unsanitized SVG content in local files and Iconify on-demand responses
CVE-2026-55877 · GHSA-6v8j-33hc-mv84
- Affected
- Packagist symfony/ux-icons >= 2.17.0, < 2.36.1; >= 3.0.0, < 3.2.0
- Fixed in
- 2.36.13.2.0· Vendor fix available
- Issue
- 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…
Recommended action: Upgrade to 3.2.0 or 2.36.1 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.