CVE-2024-45596

CVE-2024-45596 is a high-severity security vulnerability in directus (npm), affecting versions < 10.13.3. It is fixed in 10.13.3, 11.1.0, 21.0.1, 22.2.0.

Summary

Session is cached for OpenID and OAuth2 if redirect is not used

Full technical description

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.
  • Set AUTH_PROVIDERS to openid
  • Set PUBLIC_URL to the the main URL of your project . For example, PUBLIC_URL: http://localhost:8055
  • Configure AUTH_OPENID_CLIENT_ID, AUTH_OPENID_CLIENT_SECRET, AUTH_OPENID_ISSUER_URL 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 access_token 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.

CVE-2024-45596 has a CVSS score of 7.4 (High). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (10.13.3, 11.1.0, 21.0.1, 22.2.0); upgrading removes the vulnerable code path.

Affected versions

directus (< 10.13.3) directus (>= 11.0.0-rc.1, < 11.1.0) @directus/api (< 21.0.1) @directus/api (>= 22.0.0, < 22.2.0)

Security releases

directus → 10.13.3 (npm) directus → 11.1.0 (npm) @directus/api → 21.0.1 (npm) @directus/api → 22.2.0 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

directus to 10.13.3 or later; directus to 11.1.0 or later; @directus/api to 21.0.1 or later; @directus/api to 22.2.0 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2024-45596? CVE-2024-45596 is a high-severity security vulnerability in directus (npm), affecting versions < 10.13.3. It is fixed in 10.13.3, 11.1.0, 21.0.1, 22.2.0.
  2. How severe is CVE-2024-45596? CVE-2024-45596 has a CVSS score of 7.4 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2024-45596?
    • directus (npm) (versions < 10.13.3)
    • @directus/api (npm) (versions < 21.0.1)
  4. Is there a fix for CVE-2024-45596? Yes. CVE-2024-45596 is fixed in 10.13.3, 11.1.0, 21.0.1, 22.2.0. Upgrade to this version or later.
  5. Is CVE-2024-45596 exploitable, and should I be worried? Whether CVE-2024-45596 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2024-45596 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2024-45596?
    • Upgrade directus to 10.13.3 or later
    • Upgrade directus to 11.1.0 or later
    • Upgrade @directus/api to 21.0.1 or later
    • Upgrade @directus/api to 22.2.0 or later

Other vulnerabilities in directus

Stop the waste.
Protect your environment with Kodem.