CVE-2023-22477: Mercurius Mercurius Has Uncaught Exception When Vulnerability
MODERATECVE-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
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).
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.
npm install mercurius@11.5.0
npm install mercurius@8.13.2
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
CVE-2023-22477 Affected Mercurius Versions
2 component(s)| 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?
Which Mercurius versions are affected?
What version fixes CVE-2023-22477?
Is mercurius affected?
What is the CVSS score of CVE-2023-22477?
What CWE is associated with CVE-2023-22477?
How can I check npm dependencies for CVE-2023-22477?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}