CVE-2024-45596: OpenID and OAuth2 Session Caching Vulnerability in Directus
Summary
CVE-2024-45596: Session is cached for OpenID and OAuth2 if redirect is not used. Affects directus across 2 version ranges.
< 10.13.3
>= 11.0.0-rc.1, < 11.1.0
Fixed in 10.13.3 or 11.1.0, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Directus is an open-source content management system (CMS) that provides a headless API for managing and delivering content. It supports various authentication methods, including OpenID and OAuth2. These authentication methods allow users to log in to Directus using their credentials from external identity providers. However, a vulnerability exists in Directus where the session is cached for OpenID and OAuth2 if the redirect query string is not used during the authentication process. This vulnerability affects all projects using OpenID or OAuth2 without including the redirect query string.
Vulnerability Detail
The vulnerability allows an unauthenticated user to access the credentials of the last authenticated user via OpenID or OAuth2. When an unauthenticated user tries to log in via the Single Sign-On (SSO) link without the redirect query string, Directus caches the credentials of the last authenticated user. Subsequently, if the unauthenticated user tries to log in again via the SSO link, they will receive the credentials of the previous user. This occurs because Directus uses the respond middleware, which caches GET requests that meet certain conditions. However, this scenario, where an unauthenticated request returns user credentials, is not accounted for in the caching logic.
How To Fix
Latest published version: 12.5.0 as of 22 Oct 2026
npm install directus@12.5.0
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 10.13.310.13.3npm install directus@10.13.3 -
>= 11.0.0-rc.1, < 11.1.011.1.0npm install directus@11.1.0
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a workaround, users can manually clear the cache after each authentication request by restarting the Directus server or clearing the cache store. Additionally, users can modify the Directus source code to include the redirect query string in the caching logic for unauthenticated requests. However, it is recommended to apply the official fixes provided in the updated versions of Directus.
Conclusion
The OpenID and OAuth2 session caching vulnerability in Directus allows unauthenticated users to access the credentials of the last authenticated user. This can lead to unauthorized access to sensitive information and potential misuse of user accounts. It is crucial to update Directus to the fixed versions and ensure the inclusion of the redirect query string in the authentication URL to mitigate this vulnerability.
See every vulnerability recorded for directus →
FAQ
The vulnerability affects Directus versions prior to 10.13.3 for the 'directus' npm package and versions prior to 21.0.1 for the '@directus/api' npm package.
The vulnerability allows an unauthenticated user to access the credentials of the last authenticated user via OpenID or OAuth2. This can lead to unauthorized access to sensitive information and potential misuse of user accounts.
Yes, users can manually clear the cache after each authentication request or modify the Directus source code to include the redirect query string in the caching logic for unauthenticated requests. However, it is recommended to apply the official fixes provided in the updated versions of Directus.
To update Directus, follow the instructions provided in the official Directus documentation for upgrading to the latest version. Make sure to backup your data before performing any updates.
Yes, the CVSS score for this vulnerability is 7.4, indicating a high severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for directus.