mirror of
https://github.com/curl/curl.git
synced 2026-08-25 22:53:38 +03:00
urlapi: verify the IPv6 numerical address
It needs to parse correctly. Otherwise it could be tricked into letting through a-f using host names that libcurl would then resolve. Like '[ab.be]'. Reported-by: Thomas Vegas Closes #4315
This commit is contained in:
parent
ffe34b7b59
commit
eab3c580f9
2 changed files with 17 additions and 4 deletions
|
|
@ -140,6 +140,10 @@ static struct testcase get_parts_list[] ={
|
|||
"file | [11] | [12] | [13] | [14] | [15] | C:\\programs\\foo | [16] | [17]",
|
||||
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
|
||||
#endif
|
||||
{"http://[ab.be:1]/x", "",
|
||||
CURLU_DEFAULT_SCHEME, 0, CURLUE_MALFORMED_INPUT},
|
||||
{"http://[ab.be]/x", "",
|
||||
CURLU_DEFAULT_SCHEME, 0, CURLUE_MALFORMED_INPUT},
|
||||
/* URL without host name */
|
||||
{"http://a:b@/x", "",
|
||||
CURLU_DEFAULT_SCHEME, 0, CURLUE_NO_HOST},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue