mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:23:32 +03:00
cookie: refuse to load cookies set against a PSL domain
Verified by test 409 Reported-by: 1rhino2 on hackerone Closes #22500
This commit is contained in:
parent
7db9947fcf
commit
c04189523c
8 changed files with 165 additions and 61 deletions
|
|
@ -3584,11 +3584,13 @@ static CURLcode http_header_s(struct Curl_easy *data,
|
|||
* real peer hostname. */
|
||||
const char *host = data->req.cookiehost ?
|
||||
data->req.cookiehost : data->state.origin->hostname;
|
||||
const bool secure_context = Curl_secure_context(data, host);
|
||||
const unsigned char secure_context = Curl_secure_context(data, host) ?
|
||||
COOKIE_SECURE : 0;
|
||||
CURLcode result;
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||
result = Curl_cookie_add(data, data->cookies, TRUE, FALSE, v, host,
|
||||
data->state.up.path, secure_context);
|
||||
result = Curl_cookie_add(data, data->cookies, v, host,
|
||||
data->state.up.path,
|
||||
COOKIE_HTTPHEADER | secure_context);
|
||||
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue