If a client sends an incorrect request the connection should be terminated. What happens now is that the connection is not terminated and new data are appended to the buffer but the data from the buffer are never removed so the buffer grows. Kestrel does throw if the data is incorrect (https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs#L560) but the exception is then caught logged and swallowed (https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs#L87) Repro steps: - With telnet send \r\n to the server Expected behavior: - the connection is closed Actual behavior: - you can continue typing. with each new character an exception will be thrown on the server side. buffer grows. the connection is never closed Should we do some fuzzing tests in general?
If a client sends an incorrect request the connection should be terminated. What happens now is that the connection is not terminated and new data are appended to the buffer but the data from the buffer are never removed so the buffer grows. Kestrel does throw if the data is incorrect (https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs#L560) but the exception is then caught logged and swallowed (https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs#L87)
Repro steps:
Expected behavior:
Actual behavior:
Should we do some fuzzing tests in general?