Skip to content

Commit 10f73df

Browse files
committed
Be strict with error 431 header sizes
1 parent 45091fa commit 10f73df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/HttpParser.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ struct HttpParser {
461461
length -= consumed;
462462
consumedTotal += consumed;
463463

464+
/* Even if we could parse it, check for length here as well */
465+
if (consumed > MAX_FALLBACK_SIZE) {
466+
return {HTTP_ERROR_431_REQUEST_HEADER_FIELDS_TOO_LARGE, FULLPTR};
467+
}
468+
464469
/* Store HTTP version (ancient 1.0 or 1.1) */
465470
req->ancientHttp = false;
466471

0 commit comments

Comments
 (0)