elixir-grpcのgrpc_serverに脆弱性、不完全な要求でCPUを占有されるおそれ
概要
elixir-grpcのgrpc_serverとgrpcには、ストリーミングRPCで途中まで届いた要求を受けると処理が終わらなくなる無限ループの脆弱性があります。認証なしの攻撃者が接続を開いたままにすると、BEAMのスケジューラーを占有され、繰り返しの要求でサービス全体が止まるおそれがあります。grpc_serverは1.1.0、grpcは1.0.0で修正されており、修正版への更新が必要です。
AI要約
SecPulse が外部の生成 AI を使って作った要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。
elixir-grpcのgrpc_serverとgrpcには、ストリーミングRPCで途中まで届いた要求を受けると処理が終わらなくなる無限ループの脆弱性があります。認証なしの攻撃者が接続を開いたままにすると、BEAMのスケジューラーを占有され、繰り返しの要求でサービス全体が止まるおそれがあります。grpc_serverは1.1.0、grpcは1.0.0で修正されており、修正版への更新が必要です。
影響パッケージ
| パッケージ | 影響を受ける版 → 修正版 | |
|---|---|---|
| elixir-grpcgrpc_server |
0332faae5f5e132314794dbfdae5edecbccea292 以上 38955f1392cbf08eef231a347348445410455c85 未満→ 38955f1392cbf08eef231a347348445410455c85 |
38955f1392cbf08eef231a347348445410455c85 |
| elixir-grpcgrpc |
6d8a09ad919e208fb600538ac8b19bd733a04310 以上 0332faae5f5e132314794dbfdae5edecbccea292 未満→ 0332faae5f5e132314794dbfdae5edecbccea292 |
0332faae5f5e132314794dbfdae5edecbccea292 |
| Hexgrpc_server |
1.0.0 以上 1.1.0 未満→ 1.1.0 |
1.1.0 |
| Hexgrpc |
0.3.1 以上 1.0.0 未満→ 1.0.0 |
1.0.0 |
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。
Summary
Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in elixir-grpc grpc_server and grpc allows unauthenticated attackers to occupy a BEAM scheduler indefinitely via a client-streaming or bidirectional-streaming request whose body ends inside a gRPC message.
GRPC.Server.Adapters.Cowboy.read_stream/1 (grpc_server/lib/grpc/server/adapters/cowboy.ex, and the Cowboy adapter in grpc before the package split) asks for more data whenever the buffer does not hold a complete message. Once the request body has ended, every further read returns an empty chunk, so the buffer never changes and the function retries without end. A single 5-byte length prefix sent with END_STREAM keeps one scheduler busy for as long as the connection stays open, and repeated requests exhaust all schedulers.
This issue affects grpc: from 0.3.1 before 1.0.0; grpc_server: from 1.0.0 before 1.1.0.
Details
1. A partial message
A client sends a 5-byte gRPC length prefix that declares more bytes than follow it, and ends the request body with END_STREAM.
2. The reader asks for more
read_stream/1 calls GRPC.Message.get_message/1, which returns false because the declared message is incomplete. read_stream/1 then sets need_more and reads again through Handler.read_body/1.
3. Every read is empty
Once the body has been read, the handler's async_read_body/2 (and cowboy_req:read_body/2 in older releases) returns an empty chunk at once. The buffer…
出典: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
参照URL
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package hex.pm
- package hex.pm
- package github.com
- patch github.com
- patch github.com
- web cna.erlef.org
- web osv.dev
- web github.com
- web github.com
- web repo.hex.pm