Open anjmao opened 4 years ago
@anjmao Can you confirm this is still an issue?
Anyone know if this is still an issue? Seems like a security risk to me..
Does AbortSignal.timeout
resolve this issue?
https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static
I don't believe so, since that would be on the client to do. I appears this issues has been mislabeled as a feature. Instead, this is a significant DOS vulnerability.
Amazing this has been open since 2019: https://www.cloudflare.com/learning/ddos/ddos-attack-tools/slowloris/
Deno.serve
should have default limits for both accept timeout, TLS handshake timeout, and header read timeout, and response write timeout.
Deno.serve
should also have default size limits for req.text
, req.bytes
, req.arrayBuffer
, req.formData
, and req.blob
. When a user makes a request with a larger body than this default value, we'd error the request. req.body
would not be subject to these limits.
The user could customize both timeouts and the size limit in Deno.serve
:
Deno.serve({
maxBodySize: 16 * 1024 * 1024, // 16MiB,
acceptTimeout: 10000, // 10s
tlsHandshakeTimeout: 20000, // 20s
headerReadTimeout: 10000, // 10s,
responseWriteTimeout: null, // no default
});
Timeouts for TCP are similarly missing, making Deno a complete no-go for secure and robust networking applications
Deno tries to have similar standard library as Go which is great, but... Keep in mind that event Go authors made some mistakes when initially developed std. For example by default HTTP server and client doesn't add any timeouts. In order to have production ready HTTP server in Go you would want to add Read/Write timeouts.
Back to deno. For now there is only few options available.
Example for slow client attack which creates new TCP connections on the server and by slowly reading response body doesn't close it which would eventually lead to server out of file descriptors errors.
Deno server
Go test client
Check established connections with
lsof -p <PID>