CVE-2024-45596: Directus's session is cached for OpenID and OAuth2 if `redirect` is not used

Published Sep 10, 2024
·
Updated

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 CACHEENABLED to true - Set CACHESTORE 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. - Set AUTHPROVIDERS to openid - Set PUBLICURL to the the main URL of your project . For example, PUBLICURL: http://localhost:8055 - Configure AUTHOPENIDCLIENTID, AUTHOPENIDCLIENTSECRET, AUTHOPENIDISSUERURL with proper OpenID configurations - Be sure that on OpenID external app you have configured Redirect URI to http://localhost:8055/auth/login/openid/callback - Run Directus - Open the SSO link like http://localhost:8055/auth/login/openid/callback - Do the authentication on the OpenID external webpage - Verify that it you got redirected to a page with a JSON including accesstoken property - Be sure all anonymous mode windows are closed - Open an anonymous window and go to the SSO Link http://localhost:8055/auth/login/openid/callback and see you have the same credentials, even though you don't have any session because you are in anonymous mode

Impact All projects using OpenID or OAuth 2, that does not include redirect query string on loggin in users.

Other sources

Directus is a real-time API and App dashboard for managing SQL database content. An unauthenticated user can access credentials of last authenticated user via OpenID or OAuth2 where the authentication URL did not include redirect query string. 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. This vulnerability is fixed in 10.13.3 and 11.1.0.

— NVD

Affected Software

6 affected componentsFixes available
npm/@directus/api>=22.0.0<22.2.0
22.2.0
npm/@directus/api<21.0.1
21.0.1
npm/directus>=11.0.0-rc.1<11.1.0
11.1.0
npm/directus<10.13.3
10.13.3
Monospace Directus Node.js<10.13.3
Monospace Directus Node.js>=11.0.0<11.1.0

Event History

Sep 10, 2024
CVE Published
via MITRE·06:43 PM
Data Sourced
via MITRE·06:43 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:15 PM
RemedyAffected Software
Advisory Published
via GitHub·07:43 PM

Frequently Asked Questions

1

What is the severity of CVE-2024-45596?

CVE-2024-45596 has been categorized as a high-severity vulnerability due to its potential exposure of user credentials.

2

How do I fix CVE-2024-45596?

To fix CVE-2024-45596, upgrade to the specified remedial versions of affected packages listed in the advisory.

3

Who is affected by CVE-2024-45596?

CVE-2024-45596 affects users of Directus API versions between 22.0.0 and 22.2.0, as well as earlier versions of Directus.

4

What type of vulnerability is CVE-2024-45596?

CVE-2024-45596 is an authentication bypass vulnerability that allows unauthenticated users to access sensitive credentials.

5

What are the specific affected versions for CVE-2024-45596?

The specific affected versions for CVE-2024-45596 include Directus API versions 22.0.0 to 22.2.0 and earlier versions up to 21.0.1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203