Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

LOW-5 Malicious JWT access token can crash a thread of the databroker #750

Conversation

lukasmittag
Copy link
Contributor

use safe addition checked_add in decoder.rs to catch overflows and do not panic. Instead returning ClaimsError.

@lukasmittag lukasmittag requested review from argerus and erikbosch March 6, 2024 12:20
@rafaeling
Copy link
Contributor

Code looks good, some unit test would be good

@boschglobal boschglobal closed this by deleting the head repository Mar 21, 2024
@@ -171,4 +177,34 @@ AEiqOjPq0D6X45wCzIwjILUCAwEAAQ==
Err(err) => panic!("decode should succeed but failed with:{}", err),
}
}

#[test]
fn test_expiration_safe_addition() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it possibly be useful with a small comment here specifying the purpose of the test, possibly something like "Rust can only handle date up to XXXX, verify that an error is reported if token expires in year 2424"

Copy link
Contributor

@erikbosch erikbosch left a comment

Choose a reason for hiding this comment

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

Looks good to me

@lukasmittag lukasmittag merged commit bfaccc6 into eclipse:master Mar 25, 2024
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants