Directus has open redirect in SAML
Description
Directus is a real-time API and App dashboard for managing SQL database content. Prior to version 11.14.0, an open redirect vulnerability exists in the Directus SAML authentication callback endpoint. During SAML authentication, the RelayState parameter is intended to preserve the user's original destination. However, while the login initiation flow validates redirect targets against allowed domains, this validation is not applied to the callback endpoint. This allows an attacker to craft a malicious authentication request that redirects users to an arbitrary external URL upon completion. The vulnerability is present in both the success and error handling paths of the callback. This vulnerability can be exploited without authentication. Version 11.14.0 contains a patch.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
directusnpm | < 11.14.0 | 11.14.0 |
@directus/apinpm | < 32.1.1 | 32.1.1 |
Affected products
1Patches
1dad9576ea936Merge from fork (#26346)
2 files changed · +11 −2
api/src/auth/drivers/saml.ts+6 −2 modified@@ -19,9 +19,9 @@ import { AuthenticationService } from '../../services/authentication.js'; import type { AuthDriverOptions, User } from '../../types/index.js'; import asyncHandler from '../../utils/async-handler.js'; import { getConfigFromEnv } from '../../utils/get-config-from-env.js'; -import { LocalAuthDriver } from './local.js'; -import { isLoginRedirectAllowed } from '../../utils/is-login-redirect-allowed.js'; import { getSchema } from '../../utils/get-schema.js'; +import { isLoginRedirectAllowed } from '../../utils/is-login-redirect-allowed.js'; +import { LocalAuthDriver } from './local.js'; // Register the samlify schema validator samlify.setSchemaValidator(validator); @@ -175,6 +175,10 @@ export function createSAMLAuthRouter(providerName: string) { const authMode = (env[`AUTH_${providerName.toUpperCase()}_MODE`] ?? 'session') as string; + if (relayState && isLoginRedirectAllowed(relayState, providerName) === false) { + throw new InvalidPayloadError({ reason: `URL "${relayState}" can't be used to redirect after login` }); + } + try { const { sp, idp } = getAuthProvider(providerName) as SAMLAuthDriver; const { extract } = await sp.parseLoginResponse(idp, 'post', req);
.changeset/empty-areas-lead.md+5 −0 added@@ -0,0 +1,5 @@ +--- +'@directus/api': patch +--- + +Added redirect validation
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
4- github.com/advisories/GHSA-3573-4c68-g8ccghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-22032ghsaADVISORY
- github.com/directus/directus/commit/dad9576ea9362905cc4de8028d3877caff36dc23ghsax_refsource_MISCWEB
- github.com/directus/directus/security/advisories/GHSA-3573-4c68-g8ccghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.