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: DoS vector in kcp accept #469

Merged
merged 2 commits into from
Nov 3, 2020
Merged

fix: DoS vector in kcp accept #469

merged 2 commits into from
Nov 3, 2020

Conversation

paulpach
Copy link
Contributor

@paulpach paulpach commented Nov 3, 2020

Previously, if a client sends a valid hello and nothing else,
the server waits to complete the handshake before accepting other connections.
This opens a very easy to exploit DoS vector, because a single client can prevent the server from accepting other connections.

Now, the server fires a separate task for completing the handshake for each client. It does not consider the connection accepted until the handshake is completed.
This way, if a client does not cooperate with the handshake, other clients can still be accepted

Previously,  if a client sends a hello and nothing else,
the server waits to complete the handshake before accepting other connections.
This opens a very easy to exploit DoS vector.

Now,  the server fires a separate task for completing the handshake for each client.
So if a client does not cooperate with the handshake, other clients can still be accepted
@sonarcloud
Copy link

sonarcloud bot commented Nov 3, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@paulpach paulpach merged commit 6964bc6 into master Nov 3, 2020
@paulpach paulpach deleted the blockaccept branch November 3, 2020 18:11
github-actions bot pushed a commit that referenced this pull request Nov 3, 2020
## [56.4.1](v56.4.0...v56.4.1) (2020-11-03)

### Bug Fixes

* DoS vector in kcp accept ([#469](#469)) ([6964bc6](6964bc6))
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2020

🎉 This PR is included in version 56.4.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@paulpach
Copy link
Contributor Author

paulpach commented Nov 3, 2020

Actually we did not really have a problem in KCP, because the server accepts a connection after only 1 message received. This would be a problem if there was back and forth such as websocket.

That said, this will be needed to support stackable handshakes, or if we want to add a challenge/response handshake in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants