CVE-2026-21446: Php Laravel Ajax Bypass Security Guard

Security guard is conjoined with `! $request->ajax()`, so AJAX/API callers bypass the redirect/abort by setting `X-Requested-With: XMLHttpRequest`. Apply the security check to all requests and return an explicit 403/JSON response for AJAX clients instead of skipping the check.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0PHP
greprules fetch cve-2026-21446-php-laravel-ajax-bypass-security-guard --engine opengrep

Description

Security guard is conjoined with `! $request->ajax()`, so AJAX/API callers bypass the redirect/abort by setting `X-Requested-With: XMLHttpRequest`. Apply the security check to all requests and return an explicit 403/JSON response for AJAX clients instead of skipping the check.