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

Validation defaults for iat and nbf conflicts with documentation #66

Closed
matthew-nichols-westtel opened this issue Nov 9, 2018 · 7 comments

Comments

@matthew-nichols-westtel
Copy link

In the documentation (https://docs.rs/jsonwebtoken/5.0.1/jsonwebtoken/struct.Validation.html#structfield.validate_iat) it's mentioned that the validate_iat and validate_nbf fields are true by default, but in the source (https://docs.rs/jsonwebtoken/5.0.1/src/jsonwebtoken/validation.rs.html#98-99) the default value is false. This is also the behavior of the current release (5.0.1).

@Keats
Copy link
Owner

Keats commented Nov 9, 2018

Looks like I forgot to update the docs :(

@Keats
Copy link
Owner

Keats commented Nov 9, 2018

Although it is interesting in terms of UX what should be done there. We want good, secure defaults for the decoding so it should probably validate those by default if possible, meaning the api of v4 was better despite the buggy implementation (#51).

I'll think about it over the next couple of days but it looks like this needs to be re-done and it is a breaking change :(
I'll welcome any input on it, here are the things I would also like to change:

Probably a few other things but it's already a good start.

@Keats
Copy link
Owner

Keats commented Nov 9, 2018

Ah I also don't remember why Validation:algorithm is a vec sadly...

@PSeitz
Copy link

PSeitz commented Jan 7, 2019

There may be cases where there are multiple validation algorithms are used, but it's only secure if they are paired with their keys.

@Keats
Copy link
Owner

Keats commented Jan 10, 2019

Yes that's in the spec but I thought I changed that before, weird. Will be fixed in the next version

@Keats
Copy link
Owner

Keats commented Feb 4, 2019

iat validation removed for now, will open another issue to discuss the rest

@Keats
Copy link
Owner

Keats commented May 25, 2019

I think the validation issues are fixed in v6 so closing it

@Keats Keats closed this as completed May 25, 2019
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

No branches or pull requests

3 participants