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

add Transport config options to limit the number of handshakes #4248

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

marten-seemann
Copy link
Member

Fixes #3549.

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (594440b) 84.09% compared to head (ded0673) 84.08%.
Report is 1 commits behind head on master.

Files Patch % Lines
server.go 88.57% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4248      +/-   ##
==========================================
- Coverage   84.09%   84.08%   -0.00%     
==========================================
  Files         150      150              
  Lines       15401    15431      +30     
==========================================
+ Hits        12950    12975      +25     
- Misses       1950     1953       +3     
- Partials      501      503       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

transport.go Outdated
@@ -18,6 +18,11 @@ import (

var errListenerAlreadySet = errors.New("listener already set")

const (
defaultMaxNumUnvalidatedHandshakes = 32
defaultMaxNumHandshakes = 64
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values seem unreasonably low.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should set defaultMaxNumHandshakes to unlimited? It's really hard to pick a limit that fits for all.

Copy link
Collaborator

@sukunrt sukunrt Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

64 feels too low for defaultMaxNumHandshakes. This number is way too easy to DoS for even very small machines. I think a high value > 1000 is better. I think unlimited is also better than this being < 1000.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to unlimited in 77ede93. Not entirely happy with that, but we can always change it later once we come up with a better value.

server.go Outdated Show resolved Hide resolved
@marten-seemann marten-seemann merged commit 892851e into master Jan 23, 2024
34 checks passed
@marten-seemann marten-seemann deleted the retry-config branch January 23, 2024 05:06
mgjeong pushed a commit to mgjeong/quic-go that referenced this pull request Feb 13, 2024
…go#4248)

* add Transport config options to limit the number of handshakes

* fix accounting for failed handshakes

* increase handshake limits, improve documentation
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.

How to best implement address validation callback
2 participants