CVE-2024-37168: @grpc/grpc js @grpc/grpc-js Can Allocate Memory For Vulnerability
MODERATECVE-2024-37168 is a MODERATE (CVSS 5.3) @grpc/grpc-js can allocate memory for vulnerability (CWE-789: Memory Allocation with Excessive Size Value) affecting @grpc/grpc js libraries in the npm ecosystem. The issue involves @grpc/grpc-js can allocate memory for incoming messages well above configured limits. Remediation is available by upgrading affected packages to version 1.10.9, 1.9.15, 1.8.22.
CVE-2024-37168 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-2024-37168
To remediate this vulnerability, upgrade all affected @grpc/grpc js 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 @grpc/grpc-js@1.10.9
npm install @grpc/grpc-js@1.9.15
npm install @grpc/grpc-js@1.8.22
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @grpc/grpc-js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-37168, inspect your project dependencies using npm:
npm ls @grpc/grpc-js
Analyze the terminal output to locate any version of @grpc/grpc js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.9), your application is affected.
Note: The npm ls @grpc/grpc-js 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-789: Memory Allocation with Excessive Size Value, where the product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated. In @grpc/grpc js, 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-2024-37168 Affected @grpc/grpc js Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@grpc/grpc-js
|
npm |
≥ 1.10.0
< 1.10.9
|
1.10.9
|
|
@grpc/grpc-js
|
npm |
≥ 1.9.0
< 1.9.15
|
1.9.15
|
|
@grpc/grpc-js
|
npm |
< 1.8.22
|
1.8.22
|
References
Frequently Asked Questions
What is CVE-2024-37168?
Which @grpc/grpc js versions are affected?
What version fixes CVE-2024-37168?
Is @grpc/grpc-js affected?
What is the CVSS score of CVE-2024-37168?
What CWE is associated with CVE-2024-37168?
How can I check npm dependencies for CVE-2024-37168?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7v5v-9h63-cj86",
"modified" : "2024-06-11T18:28:02Z",
"published" : "2024-06-10T21:38:05Z",
"aliases" : [ "CVE-2024-37168" ],
"summary" : "@grpc/grpc-js can allocate memory for incoming messages well above configured limits",
"details" : "### Impact\nThere are two separate code paths in which memory can be allocated per message in excess of the `grpc.max_receive_message_length` channel option:\n\n 1. If an incoming message has a size on the wire greater than the configured limit, the entire message is buffered before it is discarded.\n 2. If an incoming message has a size within the limit on the wire but decompresses to a size greater than the limit, the entire message is decompressed into memory, and on the server is not discarded.\n\n### Patches\n\nThis has been patched in versions 1.10.9, 1.9.15, and 1.8.22\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" : "@grpc/grpc-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.10.0"
}, {
"fixed" : "1.10.9"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@grpc/grpc-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.9.0"
}, {
"fixed" : "1.9.15"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@grpc/grpc-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.8.22"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/grpc/grpc-node/security/advisories/GHSA-7v5v-9h63-cj86"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37168"
}, {
"type" : "WEB",
"url" : "https://github.com/grpc/grpc-node/commit/08b0422dae56467ecae1007e899efe66a8c4a650"
}, {
"type" : "WEB",
"url" : "https://github.com/grpc/grpc-node/commit/674f4e351a619fd4532f84ae6dff96b8ee4e1ed3"
}, {
"type" : "WEB",
"url" : "https://github.com/grpc/grpc-node/commit/a8a020339c7eab1347a343a512ad17a4aea4bfdb"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/grpc/grpc-node"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-789" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-10T21:38:05Z",
"nvd_published_at" : "2024-06-10T22:15:12Z"
}
}