CVE-2023-27474: Directus Directus Vulnerable To HTML Injection Vulnerability
HIGHCVE-2023-27474 is a HIGH (CVSS 7.5) directus vulnerable to html injection vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Directus libraries in the npm ecosystem. The issue involves directus vulnerable to html injection in password reset email to custom reset url. Remediation is available by upgrading affected packages to version 9.23.0.
CVE-2023-27474 at a Glance
Security Impact
CVSS: 7.5
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:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2023-27474
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@9.23.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-2023-27474, 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 9.23.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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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-2023-27474 Affected Directus Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
directus
|
npm |
< 9.23.0
|
9.23.0
|
References
Frequently Asked Questions
What is CVE-2023-27474?
Which Directus versions are affected?
What version fixes CVE-2023-27474?
Is directus affected?
What is the CVSS score of CVE-2023-27474?
What CWE is associated with CVE-2023-27474?
How can I check npm dependencies for CVE-2023-27474?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4hmq-ggrm-qfc6",
"modified" : "2023-03-07T20:35:54Z",
"published" : "2023-03-07T20:35:54Z",
"aliases" : [ "CVE-2023-27474" ],
"summary" : "directus vulnerable to HTML Injection in Password Reset email to custom Reset URL",
"details" : "### Impact\n\nInstances relying on an allow-listed reset URL are vulnerable to an HTML injection attack through the use of query parameters in the reset URL. \n\n### Patches\n\nThe problem has been resolved and released under version 9.23.0. People relying on a custom password reset URL should upgrade to 9.23.0 or later, or remove the custom reset url from the configured allow list.\n\n### Workarounds\n\nDisable the custom reset URL allow list.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "directus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.23.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/directus/directus/security/advisories/GHSA-4hmq-ggrm-qfc6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-27474"
}, {
"type" : "WEB",
"url" : "https://github.com/directus/directus/issues/17119"
}, {
"type" : "WEB",
"url" : "https://github.com/directus/directus/pull/17120"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/directus/directus"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-03-07T20:35:54Z",
"nvd_published_at" : "2023-03-06T17:15:00Z"
}
}