grpc_serverにストリーミングRPCでメモリを枯渇させられる脆弱性
Summary
認証のない攻撃者が、大きすぎるリクエストボディをストリーミングRPCで送ることで、サーバーのメモリを使い尽くしてノードを停止させられます。影響を受けるのはHex版のgrpc_serverの1.0.0以上1.0.6未満で、修正版は1.0.6です。CVSS v4.0は8.2で、早めの更新が必要です。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
認証のない攻撃者が、大きすぎるリクエストボディをストリーミングRPCで送ることで、サーバーのメモリを使い尽くしてノードを停止させられます。影響を受けるのはHex版のgrpc_serverの1.0.0以上1.0.6未満で、修正版は1.0.6です。CVSS v4.0は8.2で、早めの更新が必要です。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| elixir-grpcgrpc_server |
≥ 49e18c3ec6bb9afe2f712caad3dbab5c56a68a00, < 0b663ca53dbf0f36f7f67ff1d0026f4482a18915→ 0b663ca53dbf0f36f7f67ff1d0026f4482a18915 |
0b663ca53dbf0f36f7f67ff1d0026f4482a18915 |
| Hexgrpc_server |
≥ 1.0.0, < 1.0.6→ 1.0.6 |
1.0.6 |
Original description The description as published by the source.
Summary
Allocation of Resources Without Limits or Throttling vulnerability in elixir-grpc grpc_server allows unauthenticated attackers to exhaust memory and crash the node via an oversized client-streaming or bidirectional-streaming request body.
The streaming read clause of 'Elixir.GRPC.Server.Adapters.Cowboy.Handler':info/3 (grpc_server/lib/grpc/server/adapters/cowboy/handler.ex) never checks the configured max_body_size. Only the unary read path enforces that cap. 'Elixir.GRPC.Server.Adapters.Cowboy':reading_stream/1 (grpc_server/lib/grpc/server/adapters/cowboy.ex) appends every received chunk to its buffer until a complete length-prefixed message arrives. A client can declare a very large message and send it across many small HTTP/2 DATA frames, and the server buffers all of it.
This issue affects grpc_server: from 1.0.0 before 1.0.6.
Details
1. The cap applies to unary reads only
The commit that added max_body_size checks it in read_full_body/4, which serves unary requests through the {:read_full_body, ref, pid} clause of 'Elixir.GRPC.Server.Adapters.Cowboy.Handler':info/3. The {:read_body, ref, pid} clause, which serves streaming requests, returns each chunk to the caller with no size check.
2. Unbounded buffering
'Elixir.GRPC.Server.Adapters.Cowboy':reading_stream/1 reads chunks through that clause and appends each one to a binary buffer. It emits a message only when GRPC.Message.get_message/1 finds a complete length-prefix…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package hex.pm
- package github.com
- patch github.com
- web cna.erlef.org
- web osv.dev
- web github.com
- web github.com
- web repo.hex.pm