-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
redesign the Retry Token API #3494
Comments
Looks like RFC 9000 Section 8.1.4 answers the open question:
If we're that strict about address changes that happen between two subsequent connections, there's no reason to be less strict for the address validation that happens during the handshake. In fact, we should also validate that the port didn't change, when using a Retry token. |
I feel like problems 1 and 3 are most relevant to me/Caddy.
Yeah, so I think this is what I'm interested in. Is there a reason that I think I like your suggested solution though. It will still let us mitigate amplification attacks when under load, yeah? Am excited to get this wrapped up for Caddy 😊 |
Our current API (the
AcceptToken
config option) is confusing and error-prone. In particular:false
multiple times for a connection attempt.defaultAcceptToken
logic, if all they want to do is require address validation when their application is under load.I suggest replacing the
AcceptToken
callback with 3 config options:RequireAddressValidation(net.Addr) bool
: if set and returnstrue
, the server will perform a Retry. It is called:MaxTokenAge time.Duration
(default: 24h): allows controlling the maximum age of a token issued on a previous connection. Most ISPs assign new IP addresses once a day, so 24h seems to be a reasonable default.MaxRetryTokenAge time.Duration
(default: 5s): allows controlling the maximum age of a token issued in a Retry packet. Such a token has to be used on the same connection attempt, so 5s seems to be a reasonable default.In case the token is younger than the maximum age for the respective token type, the server would perform the following validation:
net.UDPAddr
(this is the common case): validate that the IP (but not necessarily the port) from the token matches the current remote addressnet.UDPAddr
(can happen if running on top of a customnet.PacketConn
): validate thataddr.String()
from the token matches the current addressOpen question: Is there any use case where a perfect match between the IP address in the token and the current IP address is not required? Are there cases where one would accept an entire address range as valid? What about IPv6?
The text was updated successfully, but these errors were encountered: