CVE-2023-22477: Mercurius Mercurius Has Uncaught Exception When Vulnerability

MODERATE
Advisory Identifier: GHSA-cm8h-q92v-xcfc
CVSS 5.3
CWE-248
Published
Advisory Summary

CVE-2023-22477 is a MODERATE (CVSS 5.3) mercurius has uncaught exception when vulnerability (CWE-248: Uncaught Exception) affecting Mercurius libraries in the npm ecosystem. The issue involves mercurius has uncaught exception when using subscriptions. Remediation is available by upgrading affected packages to version 11.5.0, 8.13.2.

CVE-2023-22477 at a Glance

CVE Identifier CVE-2023-22477
GHSA Identifier GHSA-cm8h-q92v-xcfc
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-248: Uncaught Exception
Affected Product Mercurius
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:N/I:N/A:L).

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

How to Fix CVE-2023-22477

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

mercurius fixed: 11.5.0
npm install mercurius@11.5.0
mercurius fixed: 8.13.2
npm install mercurius@8.13.2
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 mercurius

How to Check if You Are Affected

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

npm ls mercurius

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

Note: The npm ls mercurius 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-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Mercurius, 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 Any users of Mercurius until version v11.5.0 are subjected to a denial of service attack by sending a malformed packet over WebSocket to `/graphql`. ### Patches This was patched in https://github.com/mercurius-js/mercurius/pull/940. The patch was released as v11.5.0 and v8.13.2. ### Workarounds Disable subscriptions. ### References Reported publicly as https://github.com/mercurius-js/mercurius/issues/939. The same problem was solved in https://github.com/fastify/fastify-websocket/pull/228

CVE-2023-22477 Affected Mercurius Versions

2 component(s)
Fixed Versions:
11.5.08.13.2
Product / Package Ecosystem Affected Versions Fixed Version
mercurius
npm
≥ 9.0.0
< 11.5.0
11.5.0
mercurius
npm
< 8.13.2
8.13.2

References

Frequently Asked Questions

What is CVE-2023-22477?
CVE-2023-22477 is a security vulnerability in Mercurius involving mercurius has Uncaught Exception when using subscriptions under CWE-248: Uncaught Exception.
Which Mercurius versions are affected?
Affected versions include releases prior to 11.5.0, 8.13.2 across affected packages: mercurius.
What version fixes CVE-2023-22477?
Upgrading to 11.5.0, 8.13.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mercurius affected?
Yes, mercurius is affected in releases prior to 11.5.0, 8.13.2. Upgrade your dependency to 11.5.0, 8.13.2 or later.
What is the CVSS score of CVE-2023-22477?
CVE-2023-22477 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:N/I:N/A:L.
What CWE is associated with CVE-2023-22477?
CVE-2023-22477 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check npm dependencies for CVE-2023-22477?
Run the dependency tree command: 'npm ls mercurius'. 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-cm8h-q92v-xcfc",
  "modified" : "2023-01-10T16:15:07Z",
  "published" : "2023-01-09T21:55:44Z",
  "aliases" : [ "CVE-2023-22477" ],
  "summary" : "mercurius has Uncaught Exception when using subscriptions",
  "details" : "### Impact\n\nAny users of Mercurius until version v11.5.0 are subjected to a denial of service attack by sending a malformed packet over WebSocket to `/graphql`.\n\n### Patches\n\nThis was patched in https://github.com/mercurius-js/mercurius/pull/940.\nThe patch was released as v11.5.0 and v8.13.2.\n\n### Workarounds\n\nDisable subscriptions.\n\n### References\n\nReported publicly as https://github.com/mercurius-js/mercurius/issues/939.\nThe same problem was solved in https://github.com/fastify/fastify-websocket/pull/228\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mercurius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0"
      }, {
        "fixed" : "11.5.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mercurius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.13.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mercurius-js/mercurius/security/advisories/GHSA-cm8h-q92v-xcfc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22477"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mercurius-js/mercurius/issues/939"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-websocket/pull/228"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mercurius-js/mercurius/pull/940"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mercurius-js/mercurius"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-09T21:55:44Z",
    "nvd_published_at" : "2023-01-09T15:15:00Z"
  }
}