Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply check_max_size logic to headers as well #65

Closed
ghost opened this issue Aug 10, 2018 · 4 comments
Closed

apply check_max_size logic to headers as well #65

ghost opened this issue Aug 10, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 10, 2018

Right now it's possible to "load" the socket with large headers, so I don't think there are any checks for this scenario (other than headers count < 100).

@ghost ghost changed the title apply check_max_size to headers as well apply check_max_size logic to headers as well Aug 10, 2018
@ghost
Copy link
Author

ghost commented Aug 10, 2018

Example of a failing test (in elixir)

  test "fails on large headers" do
    cookie = "bar=" <> String.duplicate("a", 10_000_000) # 10 MB binary
    response = request(:get, "/headers", [{"cookie", cookie}]) # GET request with cookie header bar=aaaaa...
    assert match?({400, _, _}, response) or match?({:error, :closed}, response) # elli returns 200, consumes all headers
    assert {200, _, _} = request(:get, "/headers", [{"foo", "bar"}, {"baz", "bat"}])
  end

@ghost
Copy link
Author

ghost commented Aug 10, 2018

Possibly applies to the request line (get_request) as well.

GET /aaaaaaa[... and 10MB more of aaaaa] HTTP/1.1

@yurrriq
Copy link
Member

yurrriq commented Aug 13, 2018

Looks like a bug to me. Thanks for pointing it out. PRs are most welcome!

@ghost
Copy link
Author

ghost commented Aug 13, 2018

Thanks for pointing it out. PRs are most welcome!

Great! I'll try to make one today.

@ghost ghost mentioned this issue Aug 13, 2018
@ghost ghost closed this as completed Aug 13, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant