File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/Symfony/Component/Validator Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class UrlValidator extends ConstraintValidator
2323{
2424 const PATTERN = '~^
2525 (%s):// # protocol
26- (([\_\.\pL\pN-]+:)?([\_\.\pL\pN-]+)@)? # basic auth
26+ (((?: [\_\.\pL\pN-]|%%[0-9A-Fa-f]{2}) +:)?((?: [\_\.\pL\pN-]|%%[0-9A-Fa-f]{2}) +)@)? # basic auth
2727 (
2828 ([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
2929 | # or
Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ public function getValidUrls()
122122 ['http://user.name:pass.word@symfony.com ' ],
123123 ['http://user-name@symfony.com ' ],
124124 ['http://user_name@symfony.com ' ],
125+ ['http://u%24er:password@symfony.com ' ],
126+ ['http://user:pa%24%24word@symfony.com ' ],
125127 ['http://symfony.com? ' ],
126128 ['http://symfony.com?query=1 ' ],
127129 ['http://symfony.com/?query=1 ' ],
@@ -168,6 +170,8 @@ public function getInvalidUrls()
168170 ['http://:password@@symfony.com ' ],
169171 ['http://username:passwordsymfony.com ' ],
170172 ['http://usern@me:password@symfony.com ' ],
173+ ['http://nota%hex:password@symfony.com ' ],
174+ ['http://username:nota%hex@symfony.com ' ],
171175 ['http://example.com/exploit.html?<script>alert(1);</script> ' ],
172176 ['http://example.com/exploit.html?hel lo ' ],
173177 ['http://example.com/exploit.html?not_a%hex ' ],
You can’t perform that action at this time.
0 commit comments