mirror of
https://github.com/curl/curl.git
synced 2026-08-26 06:53:32 +03:00
http: return error when receiving too large header set
To avoid abuse. The limit is set to 300 KB for the accumulated size of all received HTTP headers for a single response. Incomplete research suggests that Chrome uses a 256-300 KB limit, while Firefox allows up to 1MB. Closes #11582
This commit is contained in:
parent
944e219f10
commit
3ee79c1674
6 changed files with 60 additions and 20 deletions
|
|
@ -64,6 +64,10 @@ extern const struct Curl_handler Curl_handler_wss;
|
|||
|
||||
struct dynhds;
|
||||
|
||||
CURLcode Curl_bump_headersize(struct Curl_easy *data,
|
||||
size_t delta,
|
||||
bool connect_only);
|
||||
|
||||
/* Header specific functions */
|
||||
bool Curl_compareheader(const char *headerline, /* line to check */
|
||||
const char *header, /* header keyword _with_ colon */
|
||||
|
|
@ -183,6 +187,11 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data);
|
|||
#define EXPECT_100_THRESHOLD (1024*1024)
|
||||
#endif
|
||||
|
||||
/* MAX_HTTP_RESP_HEADER_SIZE is the maximum size of all response headers
|
||||
combined that libcurl allows for a single HTTP response, any HTTP
|
||||
version. This count includes CONNECT response headers. */
|
||||
#define MAX_HTTP_RESP_HEADER_SIZE (300*1024)
|
||||
|
||||
#endif /* CURL_DISABLE_HTTP */
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue