CVE-2024-37168 @grpc/grpc-js can allocate memory for incoming messages well above configured limits

Medium 5.3 Published Updated

Attackers can cause excessive memory allocation in @grpc/grpc-js by sending large or compressed messages, leading to denial of service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-37168?

CVE-2024-37168 is a medium-severity denial of service vulnerability in grpc-node, published on 10 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

@grpc/grps-js implements the core functionality of gRPC purely in JavaScript, without a C++ addon. Prior to versions 1.10.9, 1.9.15, and 1.8.22, there are two separate code paths in which memory can be allocated per message in excess of the `grpc.max_receive_message_length` channel option: If an incoming message has a size on the wire greater than the configured limit, the entire message is buffered before it is discarded; and/or 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. This has been patched in versions 1.10.9, 1.9.15, and 1.8.22.

Weakness: CWE-789

Which versions are affected by CVE-2024-37168?

6 open source packages ship an affected version, including @grpc/grpc-js.

PackageAffectedFixed in
@grpc/grpc-js npmAll versions1.8.22
@grpc/grpc-js npmAll versions1.8.22
@grpc/grpc-js npmFrom 1.10.01.10.9
@grpc/grpc-js npmFrom 1.10.01.10.9
@grpc/grpc-js npmFrom 1.9.01.9.15
@grpc/grpc-js npmFrom 1.9.01.9.15

How do I fix CVE-2024-37168?

Upgrade @grpc/grpc-js to a fixed version for your release line: 1.8.22, 1.10.9 or 1.9.15.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-37168 being exploited?

There is no known exploitation of CVE-2024-37168 in the wild and no public exploit code.

Sources

Also known as CLEANSTART-2026-QB50814, ECHO-066d-8cdc-cc6a, GHSA-7v5v-9h63-cj86, MINI-fhw2-2jg6-whjw, ROOT-APP-NPM-CVE-2024-37168.

Is CVE-2024-37168 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free