mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:43:36 +03:00
http: fix httpsig with auth-redir
Do not let unrelated credentials from a redirected URL bypass the
cross-host auth boundary
Verified by test 5023 to 5025
Follow-up to a55731050e
Closes #22395
This commit is contained in:
parent
6b1ff5407e
commit
acf4498381
5 changed files with 213 additions and 5 deletions
15
lib/http.c
15
lib/http.c
|
|
@ -672,10 +672,17 @@ static CURLcode output_auth_headers(struct Curl_easy *data,
|
|||
#endif
|
||||
#ifndef CURL_DISABLE_HTTPSIG
|
||||
if((authstatus->picked == CURLAUTH_HTTPSIG) && !proxy) {
|
||||
auth = "HTTPSIG";
|
||||
result = Curl_output_httpsig(data);
|
||||
if(result)
|
||||
return result;
|
||||
/* HTTPSIG uses its own configured key material rather than
|
||||
data->state.creds. Do not let unrelated credentials from a
|
||||
redirected URL bypass the cross-host auth boundary. */
|
||||
if(Curl_auth_allowed_to_host(data)) {
|
||||
auth = "HTTPSIG";
|
||||
result = Curl_output_httpsig(data);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
else
|
||||
authstatus->done = TRUE;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue