Skip to content

preflight: cap Access-Control-Request-Headers length - #48

Open
team-humaki wants to merge 1 commit into
go-chi:masterfrom
team-humaki:cap-acrh-preflight
Open

team-humaki wants to merge 1 commit into
go-chi:masterfrom
team-humaki:cap-acrh-preflight

Conversation

@team-humaki

Copy link
Copy Markdown

A 1MiB comma-only Access-Control-Request-Headers value made parseHeaderList allocate on the order of tens of MiB.

Abort the preflight (same as a disallowed header list) when ACRH is longer than 1KiB. That is enough for a real Fetch preflight and matches what was suggested on the issue.

Fixes #36.

A 1MiB comma-only ACRH made parseHeaderList allocate tens of MiB.
Abort preflight when the header is longer than 1KiB, as a Fetch
browser would never send that. Fixes go-chi#36.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some malicious/spoofed preflight requests cause prohibitive load

1 participant