PHP-031 / Intermediate
XSS due to incorrect JSON response Content-Type
Why is this a problem?
Browsers interpret JSON or user responses served as text/html.
How to fix it
php
return response()->json($data)->header('X-Content-Type-Options', 'nosniff');
// Discontinue JSONP; use CORS