-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ const server = serve({ | |
fetch: app.fetch, | ||
hostname: config.listenInaddrAny ? '::' : '127.0.0.1', | ||
port, | ||
serverOptions: { | ||
maxHeaderSize: 1024 * 64, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pseudoyu
Author
Collaborator
|
||
}, | ||
}); | ||
|
||
export default server; |
@pseudoyu This brings some degree of CVE-2018-12121. Testing (see nodejs/node#27645 (comment)) shows that the maximum header size is roughly proportional to memory usage during exploitation attempts. A 64 KB maximum header size could lead to a peak memory usage of approximately 2.8 GB, easily causing a denial-of-service condition on systems with only 1 or 2 GB of RAM.
Setting the maximum header size to 32 KB, a double of the default of 16 KB, should address these edge cases; quadrupling the default seems excessive.