A crafted link can run JavaScript in the browser of anyone who opens it, on a Laravel app with debug mode turned on. This is cross-site scripting (XSS): the attacker's script runs as if it came from your site, inside the visitor's session.
Who is affected
Apps on laravel/framework 11.9.0 and later, below 11.36.0, are exposed when all of these are true:
APP_DEBUG=trueon a site that other people can reach.- A route with a route parameter throws an error and returns a 5xx error page.
- A visitor opens a link the attacker sent them.
The debug error page printed route parameters without HTML encoding. Apps with APP_DEBUG=false, the usual production setting, don't show that page and are not exposed. Releases before 11.9.0 are not affected.
What to do
Update laravel/framework to 11.36.0 or later. The fix is in laravel/framework#53869. If you can't update yet, the SBA Research advisory recommends setting APP_DEBUG=false.
Reported by Fabian Funder and Philipp Adelsberger of SBA Research. Jeremy Angele found the same issue on his own and wrote the patch.