mirror of
https://github.com/curl/curl.git
synced 2024-12-15 06:40:09 +08:00
urlapi: reject percent-decoding host name into separator bytes
CVE-2022-27780 Reported-by: Axel Chong Bug: https://curl.se/docs/CVE-2022-27780.html Closes #8826
This commit is contained in:
parent
5c7da89d40
commit
914aaab915
@ -678,8 +678,8 @@ static CURLUcode hostname_check(struct Curl_URL *u, char *hostname)
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
/* letters from the second string is not ok */
|
||||
len = strcspn(hostname, " \r\n");
|
||||
/* letters from the second string are not ok */
|
||||
len = strcspn(hostname, " \r\n\t/:#?!@");
|
||||
if(hlen != len)
|
||||
/* hostname with bad content */
|
||||
return CURLUE_BAD_HOSTNAME;
|
||||
|
Loading…
Reference in New Issue
Block a user