CVE-2023-27474: Directus Directus Vulnerable To HTML Injection Vulnerability

HIGH
Advisory Identifier: GHSA-4hmq-ggrm-qfc6
CVSS 7.5
CWE-79
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2023-27474
GHSA Identifier GHSA-4hmq-ggrm-qfc6
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Directus
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (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.

directus fixed: 9.23.0
npm install directus@9.23.0
Verify Direct and Transitive Dependencies

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

### Impact Instances relying on an allow-listed reset URL are vulnerable to an HTML injection attack through the use of query parameters in the reset URL. ### Patches The 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. ### Workarounds Disable the custom reset URL allow list.

CVE-2023-27474 Affected Directus Versions

1 component(s)
Fixed Versions:
9.23.0
Product / Package Ecosystem Affected Versions Fixed Version
directus
npm
< 9.23.0
9.23.0

References

Frequently Asked Questions

What is CVE-2023-27474?
CVE-2023-27474 is a security vulnerability in Directus involving directus vulnerable to HTML Injection in Password Reset email to custom Reset URL under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Directus versions are affected?
Affected versions include releases prior to 9.23.0 across affected packages: directus.
What version fixes CVE-2023-27474?
Upgrading to 9.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is directus affected?
Yes, directus is affected in releases prior to 9.23.0. Upgrade your dependency to 9.23.0 or later.
What is the CVSS score of CVE-2023-27474?
CVE-2023-27474 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2023-27474?
CVE-2023-27474 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for CVE-2023-27474?
Run the dependency tree command: 'npm ls directus'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}