Increase JWT issued-at window to 60s #256
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clock drift can occur in resource constraint machines. During network issues both CLs and ELs resources tend to increase a lot, which can delay message processing and affect the JWT iat window. Having a "short" window of 5 seconds can escalate bad network condition into a full disconnect between CL and EL. If that happens the network stalls. Due to this DOS vectors could be cheaper since you only need to push one of the clients out of the 5s window.
@holiman is there any reasoning for the 5s value? Proposing to increase the value has:
pros:
cons:
For this PR I picked 60s as a random value that's > 5s, but don't have any specific argument for it. Would like to hear opinions for
According to the doc:
So, if the token is stolen, what attack can you do in 60s that you can not do in 5s? For a profit driven attacker you probably want to override the fee_recepient, so in that case shorter windows reduce the change of producing a block after stealing. However, if you are able to steal one token, are you likely to be able to steal next token with higher iat?