CVE-2022-36031: Directus Directus Vulnerable To Unhandled Exception Vulnerability

MODERATE
Advisory Identifier: GHSA-77qm-wvqq-fg79
CVSS 6.5
CWE-755
Published
Advisory Summary

CVE-2022-36031 is a MODERATE (CVSS 6.5) directus vulnerable to unhandled exception vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting Directus libraries in the npm ecosystem. The issue involves directus vulnerable to unhandled exception on illegal filename_disk value. Remediation is available by upgrading affected packages to version 9.15.0.

CVE-2022-36031 at a Glance

CVE Identifier CVE-2022-36031
GHSA Identifier GHSA-77qm-wvqq-fg79
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product Directus
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2022-36031

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.15.0
npm install directus@9.15.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-2022-36031, 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.15.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-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. 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

The Directus process can be aborted by having an authorized user update the `filename_disk` value to a folder and accessing that file through the `/assets` endpoint. The vulnerability is patched and released in v9.15.0. You can prevent this problem by making sure no (untrusted) non-admin users have permissions to update the `filename_disk` field on `directus_files`. ### For more information If you have any questions or comments about this advisory: * Open a Discussion in [directus/directus](https://github.com/directus/directus/discussions) * Email us at [security@directus.io](mailto:security@directus.io) ### Credits This vulnerability was first discovered and reported by Witold Gorecki.

CVE-2022-36031 Affected Directus Versions

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

References

Frequently Asked Questions

What is CVE-2022-36031?
CVE-2022-36031 is a security vulnerability in Directus involving Directus vulnerable to unhandled exception on illegal filename_disk value under CWE-755: Improper Handling of Exceptional Conditions.
Which Directus versions are affected?
Affected versions include releases prior to 9.15.0 across affected packages: directus.
What version fixes CVE-2022-36031?
Upgrading to 9.15.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.15.0. Upgrade your dependency to 9.15.0 or later.
What is the CVSS score of CVE-2022-36031?
CVE-2022-36031 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-36031?
CVE-2022-36031 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check npm dependencies for CVE-2022-36031?
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-77qm-wvqq-fg79",
  "modified" : "2022-08-30T20:18:48Z",
  "published" : "2022-08-30T20:18:48Z",
  "aliases" : [ "CVE-2022-36031" ],
  "summary" : "Directus vulnerable to unhandled exception on illegal filename_disk value",
  "details" : "The Directus process can be aborted by having an authorized user update the `filename_disk` value to a folder and accessing that file through the `/assets` endpoint. \n\nThe vulnerability is patched and released in v9.15.0.\n\nYou can prevent this problem by making sure no (untrusted) non-admin users have permissions to update the `filename_disk` field on `directus_files`.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open a Discussion in [directus/directus](https://github.com/directus/directus/discussions)\n* Email us at [security@directus.io](mailto:security@directus.io)\n\n### Credits\n\nThis vulnerability was first discovered and reported by Witold Gorecki.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "directus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.15.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/security/advisories/GHSA-77qm-wvqq-fg79"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36031"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/directus/directus"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-755" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-08-30T20:18:48Z",
    "nvd_published_at" : "2022-08-19T21:15:00Z"
  }
}