Miggo Logo

CVE-2024-36129:
Denial of Service via Zip/Decompression Bomb sent over HTTP or gRPC

8.2

CVSS Score
3.1

Basic Information

EPSS Score
0.71236%
Published
6/5/2024
Updated
6/17/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
go.opentelemetry.io/collector/config/confighttpgo< 0.102.00.102.0
go.opentelemetry.io/collector/config/configgrpcgo< 0.102.10.102.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a denial of service caused by unsafe decompression of HTTP and gRPC requests, commonly known as a 'zip bomb' or 'decompression bomb'.

For HTTP (handled by go.opentelemetry.io/collector/config/confighttp):

  1. httpContentDecompressor: This function sets up the available decoders (like zstd, gzip) as anonymous functions. These anonymous functions, as detailed in the vulnerability description for zstd, directly use decompression libraries (e.g., zstd.NewReader) without limiting the output size. This is the root of the vulnerability for HTTP.
  2. (*decompressor).newBodyReader: This method is called for each request to get the appropriate decoder (one of the anonymous functions from httpContentDecompressor) and applies it to the request body, returning an io.ReadCloser for the decompressed stream. It directly invokes the vulnerable decompression step.
  3. (*decompressor).ServeHTTP: This method takes the decompressed stream from newBodyReader. Before the patch, it assigned this stream (which could be excessively large) to the request body without any size checks, leading to OOM when the body was later processed. The patch (commit 6e5f4142b80659b02fb4b72e476ef0c6848787cf) mitigates this by wrapping the stream with http.MaxBytesReader.

For gRPC (handled by go.opentelemetry.io/collector/config/configgrpc): The vulnerability description states a similar problem exists for gRPC with zstd compression. The PoC targets the TraceService/Export method. Before the fix (PR #10323), the collector's gRPC server used an external zstd decompression library (github.com/mostynb/go-grpc-compression/nonclobbering/zstd) that, in the context of the collector, did not adequately limit the size of the decompressed data. The fix involved replacing this with a custom internal zstd decompressor that respects size limits.

  1. (*otlpReceiver).ExportTraces (and ExportMetrics, ExportLogs): These are the application-level gRPC service methods in the OTLP receiver. When a zstd-compressed request is sent to these endpoints, the gRPC framework invokes the registered zstd decompressor. If this decompressor is vulnerable (as it was pre-patch), an OOM can occur during the request processing leading up to or during the execution of these methods. These functions would appear in a runtime profile when the vulnerability is triggered via gRPC.

The identified functions are those directly involved in the decompression process (for HTTP) or are the gRPC endpoint handlers that would be targeted by a malicious compressed gRPC request, leading to the vulnerable decompression path being taken within the gRPC framework.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry *n uns*** ***ompr*ssion vuln*r**ility *llows un*ut**nti**t** *tt**k*rs to *r*s* t** *oll**tor vi* *x**ssiv* m*mory *onsumption. ### **t*ils T** Op*nT*l*m*try *oll**tor **n*l*s *ompr*ss** *TTP r*qu*sts *y r**o*nizin* t** *ont*nt-*n*o*in*

Reasoning

T** vuln*r**ility is * **ni*l o* s*rvi** **us** *y uns*** ***ompr*ssion o* *TTP *n* *RP* r*qu*sts, *ommonly known *s * 'zip *om*' or '***ompr*ssion *om*'. *or *TTP (**n*l** *y `*o.op*nt*l*m*try.io/*oll**tor/*on*i*/*on*i**ttp`): *. `*ttp*ont*nt***om