Skip to content

[DependencyInjection][HttpClient][Routing] Reject URIs that contain invalid characters #58776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 7.2
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

The behavior of parse_url() doesn't match how browsers parse URLs. This PR ensures we won't accept URLs that are invalid per https://url.spec.whatwg.org/:

  • URLs that contain a backslash
  • or start/end with a control-char or a space
  • or contain a CR/LF/TAB character

@carsonbot carsonbot added this to the 7.2 milestone Nov 6, 2024
@carsonbot carsonbot changed the title [DependencyInjection][Routing][HttpClient] Reject URIs that contain invalid characters [DependencyInjection][HttpClient][Routing] Reject URIs that contain invalid characters Nov 6, 2024
@nicolas-grekas nicolas-grekas merged commit 352786c into symfony:7.2 Nov 6, 2024
7 of 10 checks passed
@fabpot fabpot mentioned this pull request Nov 6, 2024
@nicolas-grekas nicolas-grekas deleted the parse-url-hardening branch November 6, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants