Comments (3)
We could implement a new feature to support this something like (if it doesn't exist already),
- https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Session_Management_Cheat_Sheet.md#binding-the-session-id-to-other-user-properties
- https://security.stackexchange.com/questions/123536/replay-attack-example-for-validating-nonce?rq=1
High-level solution:
- Application client generates nonce and passes it to auth server to create JWT, with passed nonce as JTI claim and sets this nonce as http-only, secure cookie.
- Further on, whenever the JWT is passed on to microservice, it could cross check the JTI claim against the passed nonce cookie.
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.
For ex: smallrye.jwt.verify.jti.cookie = nonce
sample request: curl -v -X GET http://api.microservice.com/abcservice -H "Authorization: Bearer *" --cookie "nonce=478948"
from smallrye-jwt.
@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.
The nonce solution you propose does not work because we can't expect every user use the same nonce value.
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.
from smallrye-jwt.
@vickymicky This is a good discussion, let me convert this issue to Discussion for now, thanks
from smallrye-jwt.
Related Issues (20)
- Support standard OpenID Connect `name` claim HOT 1
- JWTParser should have `parseOnly` method HOT 1
- Support PKCS1 PEM formats
- Add the ability for JWTTokenParser to not check signature on all tokens when mp.jwt.verify.publickey.location is set HOT 2
- Support multiples configurations HOT 2
- Support AWS ALB token verification
- Add a warning to the docs that `JsonWebToken.getName` is not guaranteed to be unique
- Validate Jwt build with different keys and algorithms HOT 4
- Add `scope` method to JWT Build API
- Enhance JWT Build API to allow setting a certificate chain
- Add KeyEncryptionAlgorithm "dir" enum value HOT 1
- Typos in two of KeyEncryptionAlgorithm `ECDH-ES+*` enums HOT 1
- Error while using `smalrye.jwt.sign.key.location` properties with file: scheme HOT 8
- allow multiple signature algorithms
- Allow encryption with explicitly requested algorithm HOT 1
- add an extension point to customize evaluation time used in DefaultJWTTokenParser HOT 8
- JWTCallerPrincipalFactory is instantiated each time if not explicitly set HOT 11
- Respect `smallrye.jwt.path.groups` even if the `groups` claim is present in the token HOT 2
- Support JWS `jwk` header in JWT Build API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smallrye-jwt.