-
Notifications
You must be signed in to change notification settings - Fork 322
Open
Description
The Validation takes a Vec of Algorithm but the validation code here incorrectly ensures that the JWT's algorithm is compatible with all the specified algorithms, instead of just ensuring it finds at least one that matches.
Put otherwise, this:
if validation.validate_signature {
for alg in &validation.algorithms {
if key.family != alg.family() {
return Err(new_error(ErrorKind::InvalidAlgorithm));
}
}
}Should be more like:
if validation.validate_signature {
for alg in &validation.algorithms {
if key.family == alg.family() {
// Success: let's move on.
}
}
return Err(new_error(ErrorKind::InvalidAlgorithm));
}As it stands, it is impossible to use more than one algorithm in a validation because of this bug.
PeteX
Metadata
Metadata
Assignees
Labels
No labels