CVE-2022-26969: Directus Insecure Default Value For CORS Vulnerability

CRITICAL
Advisory Identifier: GHSA-g27j-74fp-xfpr
CVSS 9.8
CWE-942
Published
Advisory Summary

CVE-2022-26969 is a CRITICAL (CVSS 9.8) insecure default value for cors vulnerability (CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains) affecting Directus libraries in the npm ecosystem. The issue involves insecure default value for cors configuration. Remediation is available by upgrading affected packages to version 9.7.0.

CVE-2022-26969 at a Glance

CVE Identifier CVE-2022-26969
GHSA Identifier GHSA-g27j-74fp-xfpr
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains
Affected Product Directus
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-26969

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.7.0
npm install directus@9.7.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-26969, 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.7.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-942: Permissive Cross-domain Security Policy with Untrusted Domains, where the product uses a web-client protection mechanism such as a content security policy (csp) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate. 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 The default value for the `CORS_ENABLED` and `CORS_ORIGIN` configuration was set to be very permissive by default. This could lead to unauthorized access in uncontrolled environments when the configuration hasn't been changed. ### Patches The default values for CORS have been changed in https://github.com/directus/directus/pull/12022 which is released under 9.7.0 ### Workarounds Configure the CORS environment variables to match your project's usage, rather than leaving them at the (permissive) defaults. ### For more information If you have any questions or comments about this advisory: * Open an issue in [directus/directus](https://github.com/directus/directus) * Email us at [security@directus.io](mailto:security@directus.io)

CVE-2022-26969 Affected Directus Versions

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

References

Frequently Asked Questions

What is CVE-2022-26969?
CVE-2022-26969 is a security vulnerability in Directus involving Insecure default value for CORS configuration under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains.
Which Directus versions are affected?
Affected versions include releases prior to 9.7.0 across affected packages: directus.
What version fixes CVE-2022-26969?
Upgrading to 9.7.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.7.0. Upgrade your dependency to 9.7.0 or later.
What is the CVSS score of CVE-2022-26969?
CVE-2022-26969 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-26969?
CVE-2022-26969 is classified under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains (The product uses a web-client protection mechanism such as a Content Security Policy (CSP) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate.).
How can I check npm dependencies for CVE-2022-26969?
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-g27j-74fp-xfpr",
  "modified" : "2025-04-14T22:07:39Z",
  "published" : "2022-04-05T18:31:22Z",
  "aliases" : [ "CVE-2022-26969" ],
  "summary" : "Insecure default value for CORS configuration",
  "details" : "### Impact\n\nThe default value for the `CORS_ENABLED` and `CORS_ORIGIN` configuration was set to be very permissive by default. This could lead to unauthorized access in uncontrolled environments when the configuration hasn't been changed.\n\n### Patches\n\nThe default values for CORS have been changed in https://github.com/directus/directus/pull/12022 which is released under 9.7.0\n\n### Workarounds\n\nConfigure the CORS environment variables to match your project's usage, rather than leaving them at the (permissive) defaults.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [directus/directus](https://github.com/directus/directus)\n* Email us at [security@directus.io](mailto:security@directus.io)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "directus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/security/advisories/GHSA-g27j-74fp-xfpr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-26969"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/pull/12022"
  }, {
    "type" : "WEB",
    "url" : "https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/directus/directus"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/blob/8daed9c41baeaf1d08c1e292bf9f0dcef65e48fb/docs/configuration/config-options.md"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/releases/tag/v9.7.0"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-DIRECTUS-2441822"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-942" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-04-05T18:31:22Z",
    "nvd_published_at" : "2022-12-26T06:15:00Z"
  }
}