-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Default timeouts and size limits for Deno.serve
#3515
Comments
@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 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/ |
The user could customize both timeouts and the size limit in Deno.serve({
maxBodySize: 16 * 1024 * 1024, // 16MiB,
acceptTimeout: 10000, // 10s
tlsHandshakeTimeout: 20000, // 20s
headerReadTimeout: 10000, // 10s,
responseWriteTimeout: null, // no default
}); |
Deno.serve
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>
The text was updated successfully, but these errors were encountered: