Staging Environment: Content and features may be unstable or change without notice.
Search for packages
Package details: pkg:npm/%40directus/api@18.2.0
purl pkg:npm/%40directus/api@18.2.0
Next non-vulnerable version 32.2.0
Latest non-vulnerable version 32.2.0
Risk
Vulnerabilities affecting this package (9)
Vulnerability Summary Fixed by
VCID-2uz6-wjn7-kug4
Aliases:
CVE-2026-22032
GHSA-3573-4c68-g8cc
Directus has open redirect in SAML ## Security Advisory: Open Redirect in Directus SAML Authentication ### Summary An open redirect vulnerability exists in the Directus SAML authentication callback endpoint. The `RelayState` parameter is used in redirects without proper validation against an allowlist of permitted domains. ### Vulnerability Description 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. ### Impact - **Phishing**: Users can be redirected to attacker-controlled sites that mimic legitimate login pages - **Credential theft**: Chained attacks may leverage the redirect to capture OAuth tokens or authorization codes - **Trust erosion**: Users may lose confidence in the application's security posture This vulnerability can be exploited without authentication.
32.1.1
Affected by 1 other vulnerability.
VCID-4v6n-unvz-wff3
Aliases:
CVE-2024-45596
GHSA-cff8-x7jv-4fm8
Session is cached for OpenID and OAuth2 if `redirect` is not used ### 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 `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.
21.0.1
Affected by 6 other vulnerabilities.
22.2.0
Affected by 8 other vulnerabilities.
VCID-4x1w-8bx4-rqf9
Aliases:
CVE-2025-64749
GHSA-cph6-524f-3hgr
Directus Vulnerable to Information Leakage in Existing Collections ### Summary: An observable difference in error messaging was found in the Directus REST API. The `/items/{collection}` API returns different error messages for these two cases: 1. A user tries to access an existing collection which they are not authorized to access. 2. A user tries to access a non-existing collection. The two differing error messages leak the existence of collections to users which are not authorized to access these collections. ### Details: The following response returns an error message, when requesting a collection the user is not authorized to access. ``` GET /items/no-access { "errors": [ { "message": "You don't have permission to access collection \"no-access\" or it does not exist. Queried in root.", "extensions": { "reason": "You don't have permission to access collection \"no-access\" or it does not exist. Queried in root.", "code": "FORBIDDEN" } } ] } ``` The following response returns a different error message when requesting a collection which does not exist. ``` GET /items/does-not-exist { "errors": [ { "message": "You don't have permission to access this.", "extensions": { "code": "FORBIDDEN" } } ] } ``` ### Impact: The difference in errors between non-existent collections and collections blocked by permissions leak the existence of a collection to a user which is not authorized to access this object. ### Credit: Sebastian Krause - [Hackmanit GmbH](https://hackmanit.de)
32.0.0
Affected by 2 other vulnerabilities.
VCID-547q-d837-dfcz
Aliases:
CVE-2024-46990
GHSA-68g8-c275-xf2m
Directus vulnerable to SSRF Loopback IP filter bypass ### Impact If you're relying on blocking access to localhost using the default `0.0.0.0` filter this can be bypassed using other registered loopback devices (like `127.0.0.2` - `127.127.127.127`) ### Workaround You can block this bypass by manually adding the `127.0.0.0/8` CIDR range which will block access to any `127.X.X.X` ip instead of just `127.0.0.1`.
21.0.0
Affected by 7 other vulnerabilities.
22.1.1
Affected by 8 other vulnerabilities.
VCID-88w3-rw8u-rqea
Aliases:
CVE-2025-64748
GHSA-8jpw-gpr4-8cmh
Directus's conceal fields are searchable if read permissions enabled ## Summary A vulnerability allows authenticated users to search concealed/sensitive fields when they have read permissions. While actual values remain masked (`****`), successful matches can be detected through returned records, enabling enumeration attacks on sensitive data. ## Details The system permits search operations on concealed fields in the `directus_users` collection, including `token`, `tfa_secret`, `password`. Matching records are returned with masked values, but their presence confirms the searched value exists. The "Recommended Defaults" for "App Access" grant users full read permissions to their role/user records, inadvertently enabling them to search for any user's tokens, TFA secrets, and password hashes. Attackers can leverage known password hashes from breach databases to identify accounts with compromised passwords. # Impact This vulnerability enables: - **Token enumeration** - Verification of valid authentication tokens - **Password hash matching** - Identification of accounts using known compromised passwords - **Information disclosure** - Confirmation of sensitive value existence without viewing actual data - **Increased attack surface** - Default permissions automatically expose all deployments using recommended settings The risk is particularly high for password fields, where attackers can cross-reference publicly available hash databases to identify vulnerable accounts.
32.0.0
Affected by 2 other vulnerabilities.
VCID-amyt-vrj6-hycd
Aliases:
CVE-2024-47822
GHSA-vw58-ph65-6rxp
Directus inserts access token from query string into logs ### Summary Access token from query string is not redacted and is potentially exposed in system logs which may be persisted. ### Details The access token in `req.query` is not redacted when the `LOG_STYLE` is set to `raw`. If these logs are not properly sanitized or protected, an attacker with access to it can potentially gain administrative control, leading to unauthorized data access and manipulation. ### PoC 1. Set `LOG_LEVEL="raw"` in the environment. 2. Send a request with the `access_token` in the query string. 3. Notice that the `access_token` in `req.query` is not redacted. ### Impact It impacts systems where the `LOG_STYLE` is set to `raw`. The `access_token` in the query could potentially be a long-lived static token. Users with impacted systems should rotate their static tokens if they were provided using query string.
21.0.0
Affected by 7 other vulnerabilities.
VCID-gnzq-q9g9-m3a4
Aliases:
CVE-2025-30351
GHSA-56p6-qw3c-fq2g
Suspended Directus user can continue to use session token to access API ### Summary Since the user status is not checked when verifying a session token a suspended user can use the token generated in session auth mode to access the API despite their status. ### Details There is a check missing in `verifySessionJWT` to verify that a user is actually still active and allowed to access the API. Right now one can extract the session token obtained by, e.g. login in to the app while still active and then, after the user has been suspended continue to use that token until it expires. ### PoC * Create an active user * Log in with that user and note the session cookie * Suspend the user (and don't trigger an `/auth/refresh` call, as that invalidates the session * Access the API with `Authorization: Bearer <token>` ### Impact This weakens the security of suspending users.
24.0.1
Affected by 5 other vulnerabilities.
VCID-kugb-dwxd-6fhe
Aliases:
CVE-2025-55746
GHSA-mv33-9f6j-pfmc
Directus allows unauthenticated file upload and file modification due to lacking input sanitization ## Summary A vulnerability exists in the file update mechanism which allows an unauthenticated actor to modify existing files with arbitrary contents (without changes being applied to the files' database-resident metadata) and / or upload new files, with arbitrary content and extensions, which won't show up in the Directus UI. ## Details Directus exposes the CRUD operations for uploading or handling files under the `/files` route. The endpoint handler is responsible for updating an existing file identified by the provided primary key specified through the `pk` parameter. Primary keys are UUID values such as `/files/927b3abf-fb4b-4c66-bdaa-eb7dc48a51cb`. Here the `filename_disk` value is never sanitized, it's possible to pass a path containing traversal sequences (`../`) through it, but a fully arbitrary file write is not possible in case the "local" storage handler is used. (Other storage implementations haven't been checked during the research process). The `packages/storage-driver-local/src/index.ts` file defines two relevant functions: `write` and `fullpath`. The `write` method uses the `fullPath` method to create the absolute path for the to-be-created file. The `join` method is used to create the final path string. As the `fullPath` method uses `join` to create a relative path starting with the separator to be added under the download dir, this call normalizes the path and further upwards traversal is not possible during the write operation. With that being said, it is still possible, to make the system "ignore" the `temp_` prefix given to the file, resulting in an arbitrarily named file being placed in the upload folder. As a summary for the vulnerability: - It is possible, to change the contents of an existing file, as an existing UUID can be specified as the file name - The metadata won't change, so the mime type cannot be modified - This also makes the changes happen "silently", without directus knowing about the changes - A new, previously non-existent file can be created with arbitrary contents - The file won't show up in on the Directus UI, it can only be seen through other means (such as shell access) - An extension MUST be defined for the file to be modified - This prevents us from uploading executables or malware with no extensions, but these wouldn't be executable either way Recommendations for fixing the vulnerability can be found in later chapters. ## Requirements As providing a primary key is required for successful exploitation, at least one asset with a known UUID must be available for an attacker. This can usually be achieved by browsing an application that uses the given Directus instance to provide images. Naturally, the instance needs to be accessible over the network used by the attacker as well. Once network access and knowledge of at least one file UUID is available for the attacker, exploitation can be done by sending a single request. ## Potential impacts The impact of successful exploitation is highly dependent on how Directus is set up to be used by a different application. Many different configurations can be created, but the following are likely the most noteworthy: 1. Setting up a phishing site SVGs can be used to set up very sophisticated looking pages, as it allows the embedding of HTML, CSS and scripts. The issue is once again with the `default-src: none` CSP settings. This setting prevents the use of CSS in the SVG file, so the created page will look strange. While the page obviously looks strange, it's important to notice that since the domain checks out, the browser could fill out the login forms, making for a much more convincing page as shown below: An error message can be used to make it look like an error in the system! 2. Server serves files directly from the upload directory: In this setup, a server such ash nginx serves files in a static manner. The served files are loaded from a "public" folder made accessible through Directus as it's recommended in the files API docs. Quoting: "make a public folder and allow access to this", except the upload folder is directly served by the server: Since the files loaded by the server are sourced directly from the file storage, the arbitrary file write might allow an attacker to upload a webshell into the folder, giving it an arbitrary file extension. As the extension checks out as a valid PHP file for instance, and the contents are correct code, an attacker can achieve unauthenticated code execution on the server. 3. Poisoning hosted files The previous examples focused on active exploitation, but it's important to mention that the vulnerability allows for arbitrary changes in files. This can be used for many different attack primitives. Let's consider the following scenario: Directus is used not only to serve contents on a company's web page, but internally as well. Onboarding documents for new entries are hosted on the instance. Manuals with links to internal services are provided through PDF files. If the file can be accessed and modified by an attacker, it would be trivial to set up a spoofed instance which receives credentials for internal services but redirects to the original, internal service right after. ## Credits The bug was discovered by Zombor Máté, a security researcher at PCA Cyber Security (https://pcacybersecurity.com/)
28.0.2
Affected by 4 other vulnerabilities.
VCID-zjtb-sh5z-h3gg
Aliases:
CVE-2026-26185
GHSA-jr94-gj3h-c8rf
Directus Vulnerable to User Enumeration via Password Reset Timing Attack ### Summary A timing-based user enumeration vulnerability exists in the password reset functionality. When an invalid reset_url parameter is provided, the response time differs by approximately 500ms between existing and non-existing users, enabling reliable user enumeration. ### Details The password reset endpoint implements a timing protection mechanism to prevent user enumeration; however, URL validation executes before the timing protection is applied. This allows an attacker to distinguish between valid and invalid user accounts based on response timing differences. ### Impact This vulnerability violates user privacy and may facilitate targeted phishing attacks by allowing attackers to confirm the existence of user accounts.
32.2.0
Affected by 0 other vulnerabilities.
Vulnerabilities fixed by this package (0)
Vulnerability Summary Aliases
This package is not known to fix vulnerabilities.

Date Actor Action Vulnerability Source VulnerableCode Version
2026-05-30T08:30:36.967189+00:00 GitLab Importer Affected by VCID-zjtb-sh5z-h3gg https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2026-26185.yml 38.6.0
2026-05-30T08:15:07.320987+00:00 GitLab Importer Affected by VCID-2uz6-wjn7-kug4 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2026-22032.yml 38.6.0
2026-05-30T07:58:44.370423+00:00 GitLab Importer Affected by VCID-4x1w-8bx4-rqf9 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2025-64749.yml 38.6.0
2026-05-30T07:58:30.124432+00:00 GitLab Importer Affected by VCID-88w3-rw8u-rqea https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2025-64748.yml 38.6.0
2026-05-30T07:36:18.625762+00:00 GitLab Importer Affected by VCID-kugb-dwxd-6fhe https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2025-55746.yml 38.6.0
2026-05-30T07:23:39.070405+00:00 GitLab Importer Affected by VCID-amyt-vrj6-hycd https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2024-47822.yml 38.6.0
2026-05-30T07:21:33.813375+00:00 GitLab Importer Affected by VCID-gnzq-q9g9-m3a4 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2025-30351.yml 38.6.0
2026-05-30T06:59:47.605925+00:00 GitLab Importer Affected by VCID-547q-d837-dfcz https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2024-46990.yml 38.6.0
2026-05-30T06:58:19.230100+00:00 GitLab Importer Affected by VCID-4v6n-unvz-wff3 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/@directus/api/CVE-2024-45596.yml 38.6.0