CVE-2024-28239: Directus URL Redirection To Untrusted Site Vulnerability
MODERATECVE-2024-28239 is a MODERATE (CVSS 5.4) url redirection to untrusted site vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Directus libraries in the npm ecosystem. The issue involves url redirection to untrusted site in oauth2/openid in directus. Remediation is available by upgrading affected packages to version 10.10.0.
CVE-2024-28239 at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2024-28239
To remediate this vulnerability, upgrade all affected Directus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install directus@10.10.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls directus
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-28239, inspect your project dependencies using npm:
npm ls directus
Analyze the terminal output to locate any version of Directus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.10.0), your application is affected.
Note: The npm ls directus command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Directus, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-28239 Affected Directus Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
directus
|
npm |
< 10.10.0
|
10.10.0
|
References
Frequently Asked Questions
What is CVE-2024-28239?
Which Directus versions are affected?
What version fixes CVE-2024-28239?
Is directus affected?
What is the CVSS score of CVE-2024-28239?
What CWE is associated with CVE-2024-28239?
How can I check npm dependencies for CVE-2024-28239?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fr3w-2p22-6w7p",
"modified" : "2024-03-13T22:25:56Z",
"published" : "2024-03-12T20:50:48Z",
"aliases" : [ "CVE-2024-28239" ],
"summary" : "URL Redirection to Untrusted Site in OAuth2/OpenID in directus",
"details" : "### Summary\nThe authentication API has a `redirect` parameter that can be exploited as an open redirect vulnerability as the user tries to log in via the API URL https://docs.directus.io/reference/authentication.html#login-using-sso-providers /auth/login/google?redirect for example.\n\n### Details\nThere's a redirect that is done after successful login via the Auth API GET request to `directus/auth/login/google?redirect=http://malicious-fishing-site.com`, which I think is here: https://github.com/directus/directus/blob/main/api/src/auth/drivers/oauth2.ts#L394. While credentials don't seem to be passed to the attacker site, the user can be phished into clicking a legitimate directus site and be taken to a malicious site made to look like a an error message \"Your password needs to be updated\" to phish out the current password.\n\n### PoC\nTurn on any auth provider in Directus instance. Form a link to `directus-instance/auth/login/:provider_id?redirect=http://malicious-fishing-site.com`, login and get taken to malicious-site. Tested on the `ory` OAuth2 integration.\n\n### Impact\nUsers who login via OAuth2 into Directus.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "directus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.10.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/directus/directus/security/advisories/GHSA-fr3w-2p22-6w7p"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-28239"
}, {
"type" : "WEB",
"url" : "https://github.com/directus/directus/commit/5477d7d61babd7ffc2f835d399bf79611b15b203"
}, {
"type" : "WEB",
"url" : "https://docs.directus.io/reference/authentication.html#login-using-sso-providers"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/directus/directus"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-12T20:50:48Z",
"nvd_published_at" : "2024-03-12T21:15:59Z"
}
}