Use Symfony HTTP utils to generate an always valid redirect response - #3768
Merged
Conversation
Contributor
There was a problem hiding this comment.
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\HttpUtilsintoBulkOperationsController. - Replace manual
new RedirectResponse($url)redirects withHttpUtils::createRedirectResponse($request, $target)in bulk status and delete actions.
Suppressed comments (1)
src/Controller/Backend/BulkOperationsController.php:91
- Redirecting directly to the
Refererheader allows an attacker to supply an external URL (open redirect). Also,??does not treat an emptyRefereras 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.
bobvandevijver
force-pushed
the
fix/use-http-utils-redirect
branch
from
August 3, 2026 12:14
0902576 to
ab961f1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.