Symfony UX Twig and Live components printed attribute values without escaping them. If an attribute holds user input, an attacker can inject extra HTML attributes or script into the page (cross-site scripting, or XSS, which runs the attacker's code in a visitor's browser). See the Symfony advisory.

Who is affected

Apps on symfony/ux-twig-component or symfony/ux-live-component before 2.25.1 whose component templates render {{ attributes }}, or the result of only(), defaults() or without(), when any attribute value can come from a user. Components whose attributes only ever hold values you set yourself aren't exposed.

What to do

Update symfony/ux-twig-component to 2.25.1. If you use symfony/ux-live-component, update it to 2.25.1 as well: it reuses the same ComponentAttributes class, so you need both updates to get the fix.

Until you can update, Symfony suggests not rendering {{ attributes }} or the objects derived from it when they may hold untrusted values. Use {{ attributes.render('name') }} to output single attributes safely instead.

Reported by Martin Hložek and Dimitar Raichev.