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

Handling of stale handshakes #343

Closed
boaks opened this issue Jun 29, 2017 · 4 comments
Closed

Handling of stale handshakes #343

boaks opened this issue Jun 29, 2017 · 4 comments
Labels

Comments

@boaks
Copy link
Contributor

boaks commented Jun 29, 2017

During the discussion of #335 I was pointed to the current handling of stale handshakes

#335 (comment)

FMPOV I agree, that there is no reason to remove a DTLS session from the LRU cache (ConnectionStore), until the storage is required for something else.

But for "incomplete handshakes" I have my doubts, if this would not introduce a vulnerability, because some could fill the ConnectionStore with entries without having credentials, and force so other "authorized" clients to handshake again. I would therefore propose to remove the incomplete handshakes actively earlier.

So any opinions on that?

@boaks boaks added the question label Jun 29, 2017
@sbernard31
Copy link
Contributor

some could fill the ConnectionStore with entries without having credentials, and force so other "authorized" clients to handshake again.

We have the staleConnectionThreshold to "limit" this issue. (default value 30 minutes)

I would therefore propose to remove the incomplete handshakes actively earlier.

What did you have in mind exactly ? When/how do we know we can remove an incomplete handshake ?

@boaks
Copy link
Contributor Author

boaks commented Jul 5, 2017

We have the staleConnectionThreshold to "limit" this issue. (default value 30 minutes)

I principally understood, that using the same staleConnectionThreshold and cleanup only when the cache is full, is a pretty simple implementation

My concern is, that if someone attacks using a lot of incomplete handshakes, the other connections based on successful handshakes, may be "garbage collected". With a shorter threshold for connections related to "ongoing handshakes" and switching to the longer threshold when the handshake gets successful would change the order of removing them and so lower the number of removed "connections based on successful handshakes".

What did you have in mind exactly ? When/how do we know we can remove an incomplete handshake ?

Define a second, shorter threshold and use that, when a new connection with an ongoing handshake was started.
Switch to the staleConnectionThreshold when the handshake get successfully completed.

I would also like to introduce a "active remove of connections with stale handshakes" but this would be more related to "feedback" for a triggering request and so not part of this issue. (So i remove the "actively" from my first post :-) )

@sbernard31
Copy link
Contributor

My concern is, that if someone attacks using a lot of incomplete handshakes, the other connections based on successful handshakes, may be "garbage collected".

Only after staleConnectionThreshold seconds. While this timeframe, the connection is "immune". For use case where you are behind a NAT this timeframe should already be very low. (At sierra we set it at 10minutes but I think we can reduce it more than that.)

introduce an "active remove of connections with stale handshakes" but this would be more related to "feedback" for a triggering request and so not part of this issue.

FMPOV, this is the most valuable part.

@boaks
Copy link
Contributor Author

boaks commented Nov 2, 2018

Timeout for all handshakes implemented by PR #782

@boaks boaks closed this as completed Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants