Skip to content

Commit

Permalink
Be strict with error 431 header sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Mar 10, 2024
1 parent 45091fa commit 10f73df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/HttpParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ struct HttpParser {
length -= consumed;
consumedTotal += consumed;

/* Even if we could parse it, check for length here as well */
if (consumed > MAX_FALLBACK_SIZE) {
return {HTTP_ERROR_431_REQUEST_HEADER_FIELDS_TOO_LARGE, FULLPTR};
}

/* Store HTTP version (ancient 1.0 or 1.1) */
req->ancientHttp = false;

Expand Down

0 comments on commit 10f73df

Please sign in to comment.