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

fix: cancel accept if client disconnected #28

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

wille-io
Copy link
Contributor

If a client disconnects while inside the accept loop, the socket will read 0 bytes indefinitely, resulting in a DoS.
This fix returns from the accept function with a ConnectionReset error.

@bartlomieju
Copy link
Member

Thanks for the PR! Could you please add a test that exercises this scenario?

@wille-io
Copy link
Contributor Author

@bartlomieju A test was added.

@bartlomieju
Copy link
Member

Thanks, I think I will need to land #29 first before we merge this PR.

@devsnek
Copy link
Member

devsnek commented Jul 10, 2024

@wille-io could you rebase this?

@wille-io
Copy link
Contributor Author

omw

@wille-io wille-io force-pushed the cancel-accept-on-client-disconnect branch from d46f1bb to 6de75ec Compare July 10, 2024 10:05
@devsnek devsnek merged commit a1b7b64 into denoland:main Jul 12, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants