CVE-2022-39322: @keystone 6/core Field-level Access-control Bypass For Multiselect Vulnerability

CRITICAL
Advisory Identifier: GHSA-6mhr-52mv-6v6f
CVSS 9.1
CWE-285 CWE-863
Published
Advisory Summary

CVE-2022-39322 is a CRITICAL (CVSS 9.1) field-level access-control bypass for multiselect vulnerability (CWE-285: Improper Authorization) affecting @keystone 6/core libraries in the npm ecosystem. The issue involves field-level access-control bypass for multiselect field. Remediation is available by upgrading affected packages to version 2.3.1.

CVE-2022-39322 at a Glance

CVE Identifier CVE-2022-39322
GHSA Identifier GHSA-6mhr-52mv-6v6f
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-285: Improper Authorization
Affected Product @keystone 6/core
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.1

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

How to Fix CVE-2022-39322

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: 2.3.1
npm install @keystone-6/core@2.3.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-2022-39322, 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 2.3.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-285: Improper Authorization, where the product does not perform or incorrectly performs 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

#### Impact `@keystone-6/core@2.2.0 || 2.3.0` users who are using the `multiselect` field, and provided field-level access control - are vulnerable to their field-level access control not being used. List-level access control is **NOT** affected. Field-level access control for fields other than `multiselect` are **NOT** affected. Example, **you are vulnerable if** you are using field-level access control on a `multiselect` like the following: ```ts const yourList = list({ access: { // this is list-level access control, this is NOT impacted }, fields: { yourFieldName: multiselect({ // this is field-level access control, for multiselect fields // this is vulnerable access: { create: ({ session }) => session?.data.isAdmin, update: ({ session }) => session?.data.isAdmin, }, options: [ { value: 'apples', label: 'Apples' }, { value: 'oranges', label: 'Oranges' }, ], // ... }), // ... }, // ... }); ``` #### Mitigation Please upgrade to `@keystone-6/core >= 2.3.1`, where this vulnerability has been closed. #### Workarounds If for some reason you cannot upgrade your dependencies, you should stop using the `multiselect` field. #### Credits Thanks to [Marek R](https://github.com/marekryb) for reporting and submitting the pull request to fix this problem. If you have any questions around this security advisory, please don't hesitate to contact us at [security@keystonejs.com](mailto:security@keystonejs.com), or [open an issue on GitHub](https://github.com/keystonejs/keystone/issues/new/choose). If you have a security flaw to report for any software in this repository, please see our [SECURITY policy](https://github.com/keystonejs/keystone/blob/main/SECURITY.md).

CVE-2022-39322 Affected @keystone 6/core Versions

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

References

Frequently Asked Questions

What is CVE-2022-39322?
CVE-2022-39322 is a security vulnerability in @keystone 6/core involving Field-level access-control bypass for multiselect field under CWE-285: Improper Authorization.
Which @keystone 6/core versions are affected?
Affected versions include releases prior to 2.3.1 across affected packages: @keystone-6/core.
What version fixes CVE-2022-39322?
Upgrading to 2.3.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 2.3.1. Upgrade your dependency to 2.3.1 or later.
What is the CVSS score of CVE-2022-39322?
CVE-2022-39322 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2022-39322?
CVE-2022-39322 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check npm dependencies for CVE-2022-39322?
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-6mhr-52mv-6v6f",
  "modified" : "2022-10-18T17:12:46Z",
  "published" : "2022-10-18T17:12:46Z",
  "aliases" : [ "CVE-2022-39322" ],
  "summary" : "Field-level access-control bypass for multiselect field",
  "details" : "#### Impact\n\n`@keystone-6/core@2.2.0 || 2.3.0` users who are using the `multiselect` field, and provided field-level access control - are vulnerable to their field-level access control not being used.\n\nList-level access control is **NOT** affected.\n\nField-level access control for fields other than `multiselect` are **NOT** affected.\n\nExample, **you are vulnerable if** you are using field-level access control on a `multiselect` like the following:\n```ts\nconst yourList = list({\n  access: {\n    // this is list-level access control, this is NOT impacted\n  },\n  fields: {\n    yourFieldName: multiselect({\n      // this is field-level access control, for multiselect fields\n      //   this is vulnerable\n      access: {\n        create: ({ session }) => session?.data.isAdmin,\n        update: ({ session }) => session?.data.isAdmin,\n      },\n      options: [\n        { value: 'apples', label: 'Apples' },\n        { value: 'oranges', label: 'Oranges' },\n      ],\n      // ...\n    }),\n    // ...\n  },\n  // ...\n});\n```\n\n#### Mitigation\nPlease upgrade to `@keystone-6/core >= 2.3.1`, where this vulnerability has been closed.\n\n#### Workarounds\nIf for some reason you cannot upgrade your dependencies, you should stop using the `multiselect` field.\n\n#### Credits\nThanks to [Marek R](https://github.com/marekryb) for reporting and submitting the pull request to fix this problem.\n\nIf you have any questions around this security advisory, please don't hesitate to contact us at [security@keystonejs.com](mailto:security@keystonejs.com), or [open an issue on GitHub](https://github.com/keystonejs/keystone/issues/new/choose).\n\nIf you have a security flaw to report for any software in this repository, please see our [SECURITY policy](https://github.com/keystonejs/keystone/blob/main/SECURITY.md).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@keystone-6/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/keystonejs/keystone/security/advisories/GHSA-6mhr-52mv-6v6f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39322"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keystonejs/keystone/commit/65c6ee3deef23605fc72b80230908696a7a65e7c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/keystonejs/keystone"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-863" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-18T17:12:46Z",
    "nvd_published_at" : "2022-10-25T17:15:00Z"
  }
}