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
Issue: When you validate an access token using the warden/token/allowed endpoint, it returns {allowed: false} if the scopes don't match what is registered in the token. If you pass in a refresh token instead, it returns allowed: true with the entire response, regardless of scopes passed to it.
Expected result: it should either blacklist refresh tokens altogether, or at least validate the scopes passed in.
The issue is that the warden uses the introspection functionality from fosite, which in turn doesn't really care if it's a refresh or an access token. Actually, the introspection endpoint isn't caring about scopes either, which is a bit weird because fosite does, but only for access tokens, not refresh.
To resolve, I think the following must be done:
Check scopes of refresh tokens in fosite
Return token type in introspect response (fosite)
Only pass warden if token type is access token, not refresh token
aeneasr
changed the title
Warden endpoint doesn't validate refresh token scopes
warden: do not use refresh tokens as proof of authorization
Jul 6, 2017
With the new patch you are no longer able to use refresh tokens in the warden endpoint, and the introspect endpoint properly checks refresh tokens for scopes as well. Thanks for the report!
Issue: When you validate an access token using the
warden/token/allowed
endpoint, it returns{allowed: false}
if the scopes don't match what is registered in the token. If you pass in a refresh token instead, it returnsallowed: true
with the entire response, regardless of scopes passed to it.Expected result: it should either blacklist refresh tokens altogether, or at least validate the scopes passed in.
Hydra version: v0.8.7
Docker Image: oryd/hydra:v0.8.7-http
cc @yields (he's the one who ran into it while consuming the endpoint here at Segment)
The text was updated successfully, but these errors were encountered: