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

Deprecate/remove the parse() method #212

Closed
sainaen opened this issue Feb 27, 2017 · 6 comments
Closed

Deprecate/remove the parse() method #212

sainaen opened this issue Feb 27, 2017 · 6 comments
Milestone

Comments

@sainaen
Copy link
Contributor

sainaen commented Feb 27, 2017

Following the email thread “jjwt signature validation bypass” and a couple of issues here (#193, #90, plus several others related to the post in Auth0's blog):

At least some portion of JJWT users confuse the JwtParser#parse() to be the main method for parsing signed JWT-s, while in fact it will also happily parse unsigned JWT-s (even if alg header is set to something other than none.)


As a side note: I thought about proposing as a partial fix to make parse() throw if alg is not none and signature part is missing, but then decided against that, because it potentially could create an illusion of safety (“no signature → failure, I tested!”), while for the real attacker it's only one additional step to update alg header after stripping the signature.

@lhazlewood
Copy link
Contributor

Yeah, we decided a while ago to remove this before 1.0 final (it was useful for some testing and 'power' scenarios). I'll leave this open to track that modification. Thanks!

@lhazlewood lhazlewood added this to the 1.0 milestone May 23, 2017
@stefan2904
Copy link

fyi, today this issue was used in a security competition to perform an Elevation of Privilege attack:
https://hack.more.systems/writeup/2017/05/31/SCTF2017-underconstruction/

@lhazlewood
Copy link
Contributor

@stefan2904 yep, this is expected. Our documentation says don't use parse if you don't know what format the JWT is in. It will be removed before 1.0 final to prevent accidental misuse.

@lhazlewood
Copy link
Contributor

lhazlewood commented Jul 15, 2019

Given that the final RFC specification requires the alg header be specified for a JWS and JWE, this issue may no longer be necessary such that parse will always have the information necessary to process a JWT safely. Leaving this open to keep as a tracker for research.

See https://tools.ietf.org/html/rfc7515#section-4.1.1 - first paragraph, last sentence - MUST.

@lhazlewood
Copy link
Contributor

lhazlewood commented Apr 18, 2022

Per discussion here, this has been addressed in the jwe [#178] branch.

@lhazlewood
Copy link
Contributor

jwe has been merged to master. This will be reflected in the 0.12.0 release.

@lhazlewood lhazlewood modified the milestones: 1.0, 0.12.0 Oct 15, 2023
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

Successfully merging a pull request may close this issue.

3 participants