Skip to content

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.

  • 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.
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.

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).
Moderate
Hardens __unserialize against __toString trampolines.
__unserialize__toString
Fixes regex alternation anchoring in UrlGenerator requirement validation (CVE-2026-45065).
UrlGeneratorModerate
Platform1
Bumps the minimum PHP version to 8.1.
Deprecated3
Deprecates annotations in FrameworkBundle and Routing.
Deprecates annotation occurrences in FrameworkBundle and Validator.
Deprecates annotations in Routing in favor of attributes.