CVE-2026-142642: Laravel: XSS via unescaped Stringable values in Blade component attribute bag
Laravel is a web application framework. Prior to 13.43.0 and 12.73.0, 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. This issue is fixed in versions 13.43.0 and 12.73.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 13.43.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 12.73.0
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using Laravel framework versions earlier than 13.43.0 or 12.73.0 are affected if they pass user-controlled non-Htmlable objects, such as Illuminate\Support\Stringable values, into Blade component attributes through ComponentAttributeBag::merge() or prepends().
What does an attacker need to exploit it?
An attacker needs a way to supply data that the application converts or retains as a Stringable value and then places in a Blade component attribute bag. A successful payload can escape the intended attribute and add attributes such as event handlers, leading to cross-site scripting in the application's origin.
Are all Blade component attribute bags vulnerable by default?
No. The issue depends on application code placing user-controlled non-Htmlable object values into component attributes via merge() or prepends(). The provided information does not indicate that ordinary static attributes or safely handled values are affected.
How can the issue be remediated?
Upgrade Laravel to version 13.43.0 or 12.73.0, depending on the supported release line. If an immediate upgrade is not possible, avoid passing user-controlled Stringable or other non-Htmlable object values into component attribute bags through merge() or prepends().
How can teams identify potentially affected code?
Review Blade components and related application code for calls to ComponentAttributeBag::merge() or prepends() that receive values derived from request input. In particular, look for request()->string() results or other user-controlled Illuminate\Support\Stringable values being used as attribute values.