You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When one JWT is generated with custom claims and then a second JWT is parsed or generated with no claims, the second JWT contains the claims from the first JWT. This could be considered a security vulnerability because an attacker could set the claims for the second JWT as well as have the second JWT bypass validation checks (as shown below).
@little-apps thanks for the contribution, but @tymondesigns seems quite absent for this repository and I don't know when he can back to help us, and seems his the only maintainer of the library :(
Subject of the issue
When one JWT is generated with custom claims and then a second JWT is parsed or generated with no claims, the second JWT contains the claims from the first JWT. This could be considered a security vulnerability because an attacker could set the claims for the second JWT as well as have the second JWT bypass validation checks (as shown below).
Your environment
Steps to reproduce
Generate a JWT from a subject and include custom claims:
Output:
Generate a second JWT with no custom claims:
Output:
Expected behaviour
The
checkOrFail()
method throws an exception and the claims are set to fresh instances.Actual behaviour
The
checkOrFail()
method doesn't throw an exception and the expiry claim is still set to the first claim instance (with value1618263217
).The text was updated successfully, but these errors were encountered: