You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now net/http has Server.MaxHeaderBytes to limit request header size. Proposing an additional Server.MaxHeaderCount to limit total number of headers.
Rationale
Granted that Server already has quite a number of tunable fields, none address the issue of DOS attacks that send a boatload of headers. Even when limiting total header size to 64k, an attacker can still send ~13k headers in a single request. This puts visible pressure on the GC as the number of malicious requests scale up.
seankhliao
changed the title
proposal: net/http Server add option to limit header count
proposal: net/http: add option to limit header count in Server
Aug 26, 2023
Proposal
Right now
net/http
hasServer.MaxHeaderBytes
to limit request header size. Proposing an additionalServer.MaxHeaderCount
to limit total number of headers.Rationale
Granted that
Server
already has quite a number of tunable fields, none address the issue of DOS attacks that send a boatload of headers. Even when limiting total header size to 64k, an attacker can still send ~13k headers in a single request. This puts visible pressure on the GC as the number of malicious requests scale up.Implementing this is trivial with existing code.
Any hint of a workaround would be appreciated too.
The text was updated successfully, but these errors were encountered: