Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Reject upgrade requests that also have content-length specified #1570

Closed
cesarblum opened this issue Mar 29, 2017 · 3 comments
Closed

Reject upgrade requests that also have content-length specified #1570

cesarblum opened this issue Mar 29, 2017 · 3 comments
Assignees

Comments

@cesarblum
Copy link
Contributor

aspnet/Security#1121 (comment) for explanation and context.

1.0.x behavior:

https://github.com/aspnet/KestrelHttpServer/blob/rel/1.0.3/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/MessageBody.cs#L130

1.1.x behavior:

https://github.com/aspnet/KestrelHttpServer/blob/rel/1.1.1/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/MessageBody.cs#L245

Let's argue whether this is a regression fix or a breaking change 😄 But we're likely to see more people having issues like the one above.

It doesn't help that nginx's own guidance is to force the Connection: upgrade header:

http://nginx.org/en/docs/http/websocket.html

I don't know why that's the case since just forwarding the client's Connection header using the $http_Connection variable seems more reasonable than that.

cc @muratg @Eilon @davidfowl

@davidfowl
Copy link
Member

We should try out a few servers to see what their behavior is here.

@muratg
Copy link
Contributor

muratg commented Apr 7, 2017

@natemcmaster please ping @halter73 for context on this issue.

@natemcmaster natemcmaster changed the title [1.1.x] Consider aligning request body handling behavior with 1.0.x Correctly handle upgrade requests that also have content-length specified Apr 13, 2017
@natemcmaster
Copy link
Contributor

Discussed with team. Let's leave this for 2.0. Doesn't seem urgent enough for a 1.1.x patch. As noted aspnet/Security#1121, this bug only appears when the client is sending an unusual combination of Upgrade and Content-Length.

@natemcmaster natemcmaster changed the title Correctly handle upgrade requests that also have content-length specified Reject upgrade requests that also have content-length specified Apr 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants