symfony/symfony — pull request #4559 by Tobion (2012-06-12 15:40:42+00:00)
Title: [Routing] fix encoding of path segments '.' and '..'

This PR is based on 4530 and will be rebased once it is merged.

The path segments "." and ".." are interpreted as relative reference when resolving a URI. So we need to encode them as they are not (and can not be) used for this purpose by a user. Otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route. See test cases for examples. This issue can potentially be exploited by users.
Example exploit: The developer has defined a route like /blog/{slug} and let the user define the slug title himself. When the user choses ".." as slug and the developer generates a URL for this route with this slug, the resulting URL will be: /blog/...
But a link to this URI basically means / (the parent) and thus points to a complete different URI than intended. So the user could change the target URL which is a security issue.