Packages / @grpc/grpc-js / Security
@grpc/grpc-js can allocate memory for incoming messages well above configured limits
Affected releases · @grpc/grpc-js
- 1.x1.0.0 – 1.10.8Fixed in 1.10.9
- 0.8.x and older0.1.0 – 0.8.1No fix, no longer updated
On 1.x, the newest line:
npm install @grpc/grpc-js@1.10.9Affected
1.0.0 – 1.8.21
94 releases
Fixed
1.8.22
1 release
Affected
1.9.0 – 1.9.14
15 releases
Fixed
1.9.15 – 1.9.16
2 releases
Affected
1.10.0 – 1.10.8
9 releases
Fixed
1.10.9 – 1.14.6
32 releases, latest
Affected
0.1.0 – 0.8.1
49 releases
Is your project affected?
Paste your package.json, or type the range you declare for @grpc/grpc-js. It is read in your browser and sent nowhere.
What happens
Impact
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.
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.
Patches
This has been patched in versions 1.10.9, 1.9.15, and 1.8.22