mirror of
https://github.com/curl/curl.git
synced 2026-08-03 17:50:28 +03:00
headers: enforce a max number of response header to accept
The limit is 5000 headers in a single transfer. To avoid problems caused by mistakes or malice. Add test 747 to verify Reported-by: wolfsage on hackerone Closes #17281
This commit is contained in:
parent
d689bd915e
commit
40ef77b6da
5 changed files with 67 additions and 2 deletions
|
|
@ -313,6 +313,11 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header,
|
|||
return CURLE_WEIRD_SERVER_REPLY;
|
||||
}
|
||||
}
|
||||
if(Curl_llist_count(&data->state.httphdrs) >= MAX_HTTP_RESP_HEADER_COUNT) {
|
||||
failf(data, "Too many response headers, %d is max",
|
||||
MAX_HTTP_RESP_HEADER_COUNT);
|
||||
return CURLE_TOO_LARGE;
|
||||
}
|
||||
|
||||
hs = calloc(1, sizeof(*hs) + hlen);
|
||||
if(!hs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue