Closed
Description
you need to specify the algorithm in the options hash whenever you call JWT.decode to ensure that an attacker cannot bypass the algorithm verification step
Does anyone have an example of such a token?
I thought our system was exposed but I've been unable to write a failing unit test. For example:
malicious_token = JWT.encode({hi: 1}, nil, 'none')
# => "eyJhbGciOiJub25lIn0.eyJoaSI6MX0."
JWT.decode malicious_token, 'secret'
# => JWT::DecodeError: Not enough or too many segments
I cannot get JWT.decode(t, secret)
to accept an unsigned token.
Metadata
Assignees
Labels
No labels