Summary Unauthenticated user can access credentials of last authenticated user via OpenID or OAuth2 where the authentication URL did not include redirect query string. For example: – Project is configured with OpenID or OAuth2 – Project is configured with cache enabled – User tries to login via SSO link, but without redirect query string – After successful login, credentials are cached – If an unauthenticated user tries to login via SSO link, it will return the credentials of the other last user The SSO link is something like https://directus.example.com/auth/login/openid/callback, where openid is the name of the OpenID provider configured in Directus Details This happens because on that endpoint for both OpenId and Oauth2 Directus is using the respond middleware, which by default will try to cache GET requests that met some conditions. Although, those conditions do not include this scenario, when an unauthenticated request returns user credentials. For OpenID, this can be seen here: https://github.com/directus/directus/blob/main/api/src/auth/drivers/openid.ts#L453-L459 And for OAuth2 can be seen here https://github.com/directus/directus/blob/main/api/src/auth/drivers/oauth2.ts#L422-L428 PoC Create a new Directus project Set CACHE_ENABLED to true Set CACHE_STORE to redis for reliable results (if using memory with multiple nodes, it may only happen sometimes, due to cache being different for different nodes) Configure REDIS with redis string or redis host, port, user, etc….Read More
References
Back to Main