Am I affected?

type your grpc version to check

Description

Improper Handling of Highly Compressed Data (Data Amplification) vulnerability in elixir-grpc grpc (GRPC.Compressor.Gzip, GRPC.Message modules) allows a denial of service via a gzip decompression bomb.

This vulnerability is associated with program files lib/grpc/compressor/gzip.ex, lib/grpc/message.ex and program routines 'Elixir.GRPC.Compressor.Gzip':decompress/1, 'Elixir.GRPC.Message':from_data/2.

'Elixir.GRPC.Compressor.Gzip':decompress/1 calls :zlib.gunzip/1 directly on attacker-controlled bytes with no decompressed-size limit, ratio check, or incremental decoding. Because this module is the registered gzip GRPC.Compressor implementation, it is invoked automatically whenever an incoming gRPC frame carries the grpc-encoding: gzip header. :zlib.gunzip/1 allocates the entire decompressed result as a single binary, so a small highly compressible payload (for example a few kilobytes of zeros, which gzip compresses at roughly 1000:1) expands to multiple gigabytes inside a single call. The max_receive_message_length limit is enforced only against the already-decompressed message, so it provides no protection. An unauthenticated remote peer can send a single crafted frame to exhaust the BEAM node's heap and trigger an out-of-memory kill.

This issue affects grpc: from 0.4.0 before 1.0.0.

Weaknesses & attack patterns

Weakness

CWE-409 · Improper Handling of Highly Compressed Data (Data Amplification) in catalog → MITRE ↗

Attack patterns

CAPEC-130 · Excessive Allocation MITRE ↗

Affected — Hex / grpc Hex.pm ↗ Repository ↗

0.4.0 < 1.0.0 affected
every other version: unaffected
cpe cpe:2.3:a:elixir-grpc:grpc:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.GRPC.Compressor.Gzip' · 'Elixir.GRPC.Message'
source files lib/grpc/compressor/gzip.ex · lib/grpc/message.ex
routines 'Elixir.GRPC.Compressor.Gzip':decompress/1 · 'Elixir.GRPC.Message':from_data/2

Affected — GitHub / elixir-grpc/grpc Repository ↗

beae680 < 1afbab9 affected
every other version: unaffected
cpe cpe:2.3:a:elixir-grpc:grpc:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.GRPC.Compressor.Gzip' · 'Elixir.GRPC.Message'
source files lib/grpc/compressor/gzip.ex · lib/grpc/message.ex
routines 'Elixir.GRPC.Compressor.Gzip':decompress/1 · 'Elixir.GRPC.Message':from_data/2

References

Credits

Peter Ullrich Finder
Paulo Valente Remediation developer

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
« All CVEs