You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirmed. The following code reproduce the problem:
<?phpuseSymfony\Component\Validator\Constraints;
$validator = newConstraints\UrlValidator();
$const = newConstraints\Url();
// null instead of error because there is no context to build a violationvar_dump($validator->validate('http://example.com/exploit.html?<script>alert(1);</script>', $const));
…s according to RFC 3986 (e-moe)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes#22022).
Discussion
----------
[Validator] fix URL validator to detect non supported chars according to RFC 3986
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21961
| License | MIT
| Doc PR | none
Commits
-------
3599c47 [Validator] fix URL validator to detect non supported chars according to RFC 3986
The URL validator (
\Symfony\Component\Validator\Constraints\UrlValidator
) will not report a violation for the following URLI believe the specification requires that
<
and>
must be URL encoded.In comparison, the
filter_var()
will not reject the URL, but it returns a copy of the URL with everything from<
stripped.The text was updated successfully, but these errors were encountered: