Open Redirects in PHP and Laravel: Validating ?next= and Return URLs
Laravel's redirect()->to() returns full URLs like https://evil.example or //evil.example unchanged, so redirect($request->input('next')) is an open redirect. Accept only single-slash local paths (or an explicit host allowlist), reject backslashes and control characters, and fall back to a safe default.
