Upgrading symfony/routing 5 to 6
Breakingv5.4.57 → v6.4.51Breaking3Security8Platform1Deprecated3New14Changed5Fixed37Other1
BreakingUpgrade verdict
3 breaking changes and a platform requirement change and 8 security fixes.
In plain terms
- Deprecated code paths from earlier versions are gone, so code that still used them must be updated.
- The constructor no longer accepts a variable number of arguments.
- Classes no longer implement PHP's Serializable interface, so code relying on that interface will break.
- This version requires PHP 8.1 or newer.
Must act Top 5 of 15 that need code or config changes
PHP requirement changed in v6.1.0-BETA1: >=7.2.5 → >=8.1.
Drops symfony/polyfill-php80.
Moves symfony/deprecation-contracts ^2.1|^3 → ^2.5|^3. Your build may pick other versions.
What you must change
Breaking3
Removes the deprecation layer.
Removes the variadic constructor signature.
Removes Serializable implementations.
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.
Prevents host placeholders from matching the path in compiled matchers.
Marks this as a security release.
Fixes dot-segment encoding for chained "../" and "./" 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.1.
Deprecations to plan for
Deprecated3
Deprecates annotations in FrameworkBundle and Routing.
Deprecates annotation occurrences in FrameworkBundle and Validator.
Deprecates annotations in Routing in favor of attributes.