Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:

I found this page to be uesful : https://url.spec.whatwg.org/#host-parsing and 
following the steps it seems that this should raise an error since at the 7th 
step it denotes that asciiDomain shouldn't contain forbidden host code point 
including "[]" . As another data point using 'new 
URL("http://benign.com[attacker.com]";)' in browser's Javascript console also 
raises exception that this is a bad URL. Even if attacker.com is assumed to be 
the correct host by Python it's not validated to be an IPV6 address where it 
should fail.

Ruby seems to use a regex : 
https://github.com/ruby/ruby/blob/trunk/lib/uri/rfc3986_parser.rb#L6
Java parseurl : 
http://hg.openjdk.java.net/jdk/jdk/file/c4c225b49c5f/src/java.base/share/classes/java/net/URLStreamHandler.java#l124
golang : 
https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/net/url/url.go#L587

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36338>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to