Directus's session is cached for OpenID and OAuth2 if `redirect` is not used
Description
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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
directusnpm | < 10.13.3 | 10.13.3 |
directusnpm | >= 11.0.0-rc.1, < 11.1.0 | 11.1.0 |
@directus/apinpm | < 21.0.1 | 21.0.1 |
@directus/apinpm | >= 22.0.0, < 22.2.0 | 22.2.0 |
Affected products
1Patches
2769fa22797bfMerge commit from fork
2 files changed · +6 −0
api/src/middleware/respond.ts+1 −0 modified@@ -27,6 +27,7 @@ export const respond: RequestHandler = asyncHandler(async (req, res) => { if ( (req.method.toLowerCase() === 'get' || req.originalUrl?.startsWith('/graphql')) && + req.originalUrl?.startsWith('/auth') === false && env['CACHE_ENABLED'] === true && cache && !req.sanitizedQuery.export &&
.changeset/orange-suns-fry.md+5 −0 added@@ -0,0 +1,5 @@ +--- +'@directus/api': patch +--- + +Fixed an issue that could cause the response cache to misbehave
4aace0bbe572Merge commit from fork
2 files changed · +6 −0
api/src/middleware/respond.ts+1 −0 modified@@ -27,6 +27,7 @@ export const respond: RequestHandler = asyncHandler(async (req, res) => { if ( (req.method.toLowerCase() === 'get' || req.originalUrl?.startsWith('/graphql')) && + req.originalUrl?.startsWith('/auth') === false && env['CACHE_ENABLED'] === true && cache && !req.sanitizedQuery.export &&
.changeset/orange-suns-fry.md+5 −0 added@@ -0,0 +1,5 @@ +--- +'@directus/api': patch +--- + +Fixed an issue that could cause the response cache to misbehave
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/advisories/GHSA-cff8-x7jv-4fm8ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-45596ghsaADVISORY
- github.com/directus/directus/blob/main/api/src/auth/drivers/oauth2.tsghsaWEB
- github.com/directus/directus/blob/main/api/src/auth/drivers/openid.tsghsaWEB
- github.com/directus/directus/commit/4aace0bbe57232e38cd6a287ee475293e46dc91bghsax_refsource_MISCWEB
- github.com/directus/directus/commit/769fa22797bff5a9231599883b391e013f122e52ghsax_refsource_MISCWEB
- github.com/directus/directus/security/advisories/GHSA-cff8-x7jv-4fm8ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.