Upgrading symfony/routing 6 to 7
Breakingv6.4.51 → v7.4.24Breaking3Security8Platform1Deprecated6New16Changed3Fixed41Other2
BreakingUpgrade verdict
3 breaking changes and a platform requirement change and 8 security fixes.
In plain terms
- Routes can no longer be defined with Doctrine annotations; use attributes instead.
- Removes remaining deprecated code paths.
- Removes backward-compatibility layers related to new methods and new parameters.
- This version requires PHP 8.2 or newer.
Must act Top 5 of 18 that need code or config changes
PHP requirement changed in v7.0.0-BETA1: >=8.1 → >=8.2.
What you must change
Breaking3
Removes Doctrine annotations support from Routing.
Removes remaining deprecated code paths.
Removes backward-compatibility layers related to new methods and new parameters.
Security8
Rejects host parameters that contain forbidden characters.
Prevents generated URLs from pointing to another host.
Prevents router redirects from sending paths starting with // to another host.
Fixes a security issue where host placeholders could match the path in compiled matchers.
Marks the release as a security release.
Fixes dot-segment encoding for chained "../" and "./" sequences in generated URLs (CVE-2026-48784).
ModerateHardens __unserialize against __toString trampolines.
__unserialize__toStringFixes regex alternation anchoring in UrlGenerator requirement validation (CVE-2026-45065).
UrlGeneratorModeratePlatform1
Bumps the minimum PHP version to 8.2.
Deprecations to plan for
Deprecated6
Deprecates the XML configuration format.
Deprecates using $this or the internal scope of the loader from PHP config files.
$thisDeprecates annotation aliases and getters and setters in favor of public properties on attributes.
Deprecates annotations in FrameworkBundle and Routing.
Deprecates annotation occurrences in FrameworkBundle and Validator.
Deprecates annotations in Routing in favor of attributes.