-
-
Notifications
You must be signed in to change notification settings - Fork 12k
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
rest/user/whoami requests working with expired jwt #535
Comments
I do not verify the validity explicitly anywhere in the code... I guess that would make a nice third JWT challenge to authenticate with an expired token... 👍 |
Yes! But you validate the validity of the tokens every time you say that only authenticated users are allowed to get or alter a resource via api or rest requests, because the express-jwt node module implicitly validates all claims. So the use of an expired token for normal session use is not possible. Only for this single rest route the validation is not done. |
Okay, that's probably because the route can be called anonymously as well... Nice accidental loophole, I guess! 😁 |
Exactly! I figured this out checking that the application is behaving right when the session token is expired and chose this route for my demo. I had read the code first and only started the intruder to cross check the hypothesis that using an expired token will not work.. which just broke my demo 😄 - lucky shot I think 😆. |
@bkimminich I tried to understand the functionality of the api
But when the request contains the cookie header, i.e,
The response is:
As suggested by the api code, i.e:
It performs as expected. |
* Properly override the jinja environment
This thread has been automatically locked because it has not had recent activity after it was closed. 🔒 Please open a new issue for regressions or related bugs. |
Hi!
Is it intended that the
rest/user/whoami
requests are working with expired jwts? The user's information will still be extracted and returned as json if the supplied token'sexp
is expired instead of returning an empty object as this is done with invalid requests or unauthenticated requests.For demo purposes I decreased the validity of the jwts from 5 hours to 10 minutes in
insecurity.js
line 27:Request:
The jwt's payloads are:
The
exp
field in readable format:Mon Apr 16 2018 14:02:55 GMT+0000
Response:
Is this intended or is this a bug? I know that the information responded is reflected from the jwt's payloads but I think that information from the jwt should only be returned when the jwt is valid.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: