Security related fixes#3723
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces security hardening by enabling Symfony trusted host validation by default and replacing ad-hoc SVG JavaScript checks with a dedicated SVG sanitization library during uploads.
Changes:
- Add
framework.trusted_hostsconfiguration driven bySYMFONY_TRUSTED_HOSTS(including a YAML migration). - Replace the SVG upload validation callback with
enshrined/svg-sanitize-based sanitization that rewrites the temporary upload. - Document and announce the security-related changes in
.envandCHANGELOG.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
yaml-migrations/m_2026-05-14-framework.yaml |
Adds a migration to introduce trusted hosts config into config/packages/framework.yaml on upgrade. |
src/Controller/Backend/Async/UploadController.php |
Switches SVG validation to library-based sanitization and writes sanitized SVG back to the temp file. |
config/packages/framework.yaml |
Enables framework.trusted_hosts with an env-driven pattern. |
composer.json |
Adds the enshrined/svg-sanitize dependency used by the upload controller. |
CHANGELOG.md |
Adds a 6.1.3 security release entry describing the changes. |
.env |
Adds guidance (commented) for setting SYMFONY_TRUSTED_HOSTS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d55d4ef to
1f54d87
Compare
Backport the default value from Symfony 7.1+ for easy configuration against Host Header Injection
1f54d87 to
987e02d
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.