GHSA-hv67-wfqj-w9xv: XSS via unescaped Stringable values in Blade component attribute bag
- Published:
- Fetched:
- Updated:
- Affects:
- laravel laravel/framework
https://github.com/laravel/framework/security/advisories/GHSA-hv67-wfqj-w9xv ↗
XSS via unescaped Stringable values in Blade component attribute bag ### Impact Blade component attribute bags did not HTML-escape non-`Htmlable` object values, such as `Illuminate\Support\Stringable`, passed to `ComponentAttributeBag::merge()` or `prepends()`. Applications that place user-controlled `Stringable` values (for example, the result of `request()->string()`) into component attributes could allow an attacker to break out of the attribute and inject arbitrary attributes, such as event handlers. This results in cross-site scripting that runs in the origin of the application. ### Patches The fix escapes all attribute values except `null`, booleans and `Htmlable` instances, and also escapes values wrapped with `prepends()`. It was merged to the 12.x branch in https://github.com/laravel/framework/pull/62503. ### Workarounds Cast user-controlled values to plain strings, for example `request()->string('title')->toString()`, before passing them to `merge()` or `prepends()`. Affected packages: composer:laravel/framework Patched: laravel/framework >=13.43.0, laravel/framework >=12.73.0