Skip to content

Use Symfony HTTP utils to generate an always valid redirect response - #3768

Merged
bobvandevijver merged 1 commit into
6.1from
fix/use-http-utils-redirect
Aug 3, 2026
Merged

Use Symfony HTTP utils to generate an always valid redirect response#3768
bobvandevijver merged 1 commit into
6.1from
fix/use-http-utils-redirect

Conversation

@bobvandevijver

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings August 3, 2026 12:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates backend bulk operation redirects to use Symfony Security’s HttpUtils for redirect response creation, aiming to produce redirects that are consistently valid in the context of the current request.

Changes:

  • Inject Symfony\Component\Security\Http\HttpUtils into BulkOperationsController.
  • Replace manual new RedirectResponse($url) redirects with HttpUtils::createRedirectResponse($request, $target) in bulk status and delete actions.
Suppressed comments (1)

src/Controller/Backend/BulkOperationsController.php:91

  • Redirecting directly to the Referer header allows an attacker to supply an external URL (open redirect). Also, ?? does not treat an empty Referer as missing. Consider validating/sanitizing the header (same-host or relative only) and falling back when it is empty/invalid.
        return $this->httpUtils->createRedirectResponse(
            $request,
            $request->headers->get('referer') ?? $this->generateUrl('bolt_dashboard')
        );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Controller/Backend/BulkOperationsController.php
Comment thread src/Controller/Backend/BulkOperationsController.php
@bobvandevijver
bobvandevijver force-pushed the fix/use-http-utils-redirect branch from 0902576 to ab961f1 Compare August 3, 2026 12:14
@bobvandevijver
bobvandevijver merged commit f86e305 into 6.1 Aug 3, 2026
34 of 35 checks passed
@bobvandevijver
bobvandevijver deleted the fix/use-http-utils-redirect branch August 3, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants