mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:13:33 +03:00
cookie: reject control octets in file-loaded cookies
Verified by test 2311 Closes #22070
This commit is contained in:
parent
9ccc80b192
commit
4a86af9940
3 changed files with 65 additions and 1 deletions
|
|
@ -786,6 +786,14 @@ static CURLcode parse_netscape(struct Cookie *co,
|
|||
/* we did not find the sufficient number of fields */
|
||||
return CURLE_OK;
|
||||
|
||||
/* Reject control octets in the name or value, matching the filtering done
|
||||
for cookies set over HTTP. A cookie loaded from a file is later sent in
|
||||
request headers, so the same bytes that make a server reject a request
|
||||
must not slip in through the file. */
|
||||
if(invalid_octets(co->name, strlen(co->name)) ||
|
||||
invalid_octets(co->value, strlen(co->value)))
|
||||
return CURLE_OK;
|
||||
|
||||
*okay = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue