CVE-2023-40027: @keystone 6/core When `ui.isAccessAllowed` Is `undefined`, The Vulnerability

MODERATE
Advisory Identifier: GHSA-9cvc-v7wm-992c
CVSS 5.3
CWE-862
Published
Advisory Summary

CVE-2023-40027 is a MODERATE (CVSS 5.3) when `ui.isaccessallowed` is `undefined`, the vulnerability (CWE-862: Missing Authorization) affecting @keystone 6/core libraries in the npm ecosystem. The issue involves when `ui.isaccessallowed` is `undefined`, the `adminmeta` graphql query is publicly accessible. Remediation is available by upgrading affected packages to version 5.5.1.

CVE-2023-40027 at a Glance

CVE Identifier CVE-2023-40027
GHSA Identifier GHSA-9cvc-v7wm-992c
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-862: Missing Authorization
Affected Product @keystone 6/core
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L/I:N/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 Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-40027

To remediate this vulnerability, upgrade all affected @keystone 6/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@keystone-6/core fixed: 5.5.1
npm install @keystone-6/core@5.5.1
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 @keystone-6/core

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2023-40027, inspect your project dependencies using npm:

npm ls @keystone-6/core

Analyze the terminal output to locate any version of @keystone 6/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.5.1), your application is affected.

Note: The npm ls @keystone-6/core 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-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In @keystone 6/core, 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

### Summary When `ui.isAccessAllowed` is `undefined`, the `adminMeta` GraphQL query is publicly accessible, that is to say, no session is required for the query. This is different to the behaviour of the default AdminUI middleware, which by default will only be publicly accessible if a `session` strategy is not defined. ### Impact This vulnerability does not affect developers using the `@keystone-6/auth` package, or any users that have written their own `ui.isAccessAllowed` (that is to say, you are unaffected if `ui.isAccessAllowed` is defined). This vulnerability does affect developers who thought that their `session` strategy will, by default, enforce that `adminMeta` is inaccessible by the public in accordance with that strategy; akin to the behaviour of the AdminUI middleware. ### Patches This vulnerability has been patched in `@keystone-6/core` version `5.5.1`. ### Workarounds You can opt to write your own `isAccessAllowed` to work-around this vulnerability. ### References Pull request https://github.com/keystonejs/keystone/pull/8771

CVE-2023-40027 Affected @keystone 6/core Versions

1 component(s)
Fixed Versions:
5.5.1
Product / Package Ecosystem Affected Versions Fixed Version
@keystone-6/core
npm
< 5.5.1
5.5.1

References

Frequently Asked Questions

What is CVE-2023-40027?
CVE-2023-40027 is a security vulnerability in @keystone 6/core involving When `ui.isAccessAllowed` is `undefined`, the `adminMeta` GraphQL query is publicly accessible under CWE-862: Missing Authorization.
Which @keystone 6/core versions are affected?
Affected versions include releases prior to 5.5.1 across affected packages: @keystone-6/core.
What version fixes CVE-2023-40027?
Upgrading to 5.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @keystone-6/core affected?
Yes, @keystone-6/core is affected in releases prior to 5.5.1. Upgrade your dependency to 5.5.1 or later.
What is the CVSS score of CVE-2023-40027?
CVE-2023-40027 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2023-40027?
CVE-2023-40027 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check npm dependencies for CVE-2023-40027?
Run the dependency tree command: 'npm ls @keystone-6/core'. 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-9cvc-v7wm-992c",
  "modified" : "2023-08-15T20:04:14Z",
  "published" : "2023-08-15T20:04:14Z",
  "aliases" : [ "CVE-2023-40027" ],
  "summary" : "When `ui.isAccessAllowed` is `undefined`, the `adminMeta` GraphQL query is publicly accessible",
  "details" : "### Summary\nWhen `ui.isAccessAllowed` is `undefined`, the `adminMeta` GraphQL query is publicly accessible, that is to say, no session is required for the query.\n\nThis is different to the behaviour of the default AdminUI middleware, which by default will only be publicly accessible if a `session` strategy is not defined. \n\n### Impact\nThis vulnerability does not affect developers using the `@keystone-6/auth` package, or any users that have written their own `ui.isAccessAllowed` (that is to say, you are unaffected if `ui.isAccessAllowed` is defined).\n\nThis vulnerability does affect developers who thought that their `session` strategy will, by default, enforce that `adminMeta` is inaccessible by the public in accordance with that strategy; akin to the behaviour of the AdminUI middleware.\n\n### Patches\nThis vulnerability has been patched in `@keystone-6/core` version `5.5.1`.\n\n### Workarounds\nYou can opt to write your own `isAccessAllowed` to work-around this vulnerability.\n\n### References\nPull request https://github.com/keystonejs/keystone/pull/8771\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@keystone-6/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/keystonejs/keystone/security/advisories/GHSA-9cvc-v7wm-992c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-40027"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keystonejs/keystone/pull/8771"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keystonejs/keystone/commit/650e27e6e9b42abfb94c340c8470faf61f0ff284"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/keystonejs/keystone"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keystonejs/keystone/releases/tag/2023-08-15"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-15T20:04:14Z",
    "nvd_published_at" : "2023-08-15T18:15:10Z"
  }
}