How to avoid unexpired JWT replay attack ? #740
Replies: 3 comments 1 reply
-
We could implement a new feature to support this something like (if it doesn't exist already),
High-level solution:
This way, the attacker needs the cookie set by the application to perform the attack. We could introduce a new property called, "smallrye.jwt.verify.jti.cookie" and the value could be the cookie name which it needs to use to validate against with. sample request: curl -v -X GET http://api.microservice.com/abcservice -H "Authorization: Bearer *" --cookie "nonce=478948" |
Beta Was this translation helpful? Give feedback.
-
@vickymicky I believe it is not in scope of smallrye-jwt to deal with such concerns, there is no notion of session in smallrye-jwt - it verifies bearer access tokens, even if they may be coming as cookie values. Such issues has to be dealt at the higher level, EAP, Quarkus, firewalls. I think what smallrye-jwt can help with is to restrict how long an access token can be accepted for, using its time to live property. For example, the token can be valid for 1 day, but you can restrict to be usable for 1 hour only from the moment it was issued. Beyond that, indeed, using HTTPS, if needed, MTLS, as well as not making access tokens valid for a long time, all all the good measures. |
Beta Was this translation helpful? Give feedback.
-
@vickymicky This is a good discussion, let me convert this issue to Discussion for now, thanks |
Beta Was this translation helpful? Give feedback.
-
JWT is created using either signed or encrypted.
Scenario:
Attack Scenario:
Somehow, JWT was acquired from the user system by the hacker and the attacker keeps replaying the step 3 to overload the microservice or manipulate the request to get desired response, as long as the JWT lives.
Application could use TLS and HTTPS set up to avoid any one sniffing the network, but still if the JWT is acquired by other mechanism, these might lead to issues.
Beta Was this translation helpful? Give feedback.
All reactions