提交 #1052957: Trendyol kafka-konsumer ⁠< 2.6.18⁠ Denial of Service (DoS)信息

标题Trendyol kafka-konsumer ⁠< 2.6.18⁠ Denial of Service (DoS)
描述Summary When BatchConfiguration.MessageGroupByteSizeLimit is enabled, a producer able to write to the consumed Kafka topic can publish a single message larger than that limit and crash the consumer process. The message is not committed, so a managed restart can replay it and cause a crash loop. Details Details In batch_consumer.go, chunkMessagesOptimized checks whether adding a message would exceed the configured chunk byte limit. If the current chunk is empty, it calls panic instead of returning an error or handling the record. batchConsumer.consume calls this function while flushing batches, before dispatching messages to the application callback and before committing their offsets. A single oversized record can therefore terminate the whole Go process. Because the offset is not committed before the panic, restarting the consumer can replay the same record and crash again. This affects batch consumers configured with a positive MessageGroupByteSizeLimit; the record must also be within the Kafka broker and reader size limits. Relevant source: batch_consumer.go:204–225 and batch_consumer.go:245–264. Proof of concept Create a Kafka topic named input on a broker at localhost:9092. Start a consumer configured as follows: consumer, err := konsumer.NewConsumer(&konsumer.ConsumerConfig{ Reader: konsumer.ReaderConfig{ Brokers: []string{"localhost:9092"}, Topic: "input", GroupID: "crash-repro", MaxBytes: 2 << 20, }, Concurrency: 1, BatchConfiguration: &konsumer.BatchConfiguration{ MessageGroupLimit: 1, MessageGroupByteSizeLimit: 1024, BatchConsumeFn: func([]*konsumer.Message) error { return nil }, }, }) if err != nil { log.Fatal(err) } consumer.Consume() select {} Using github.com/segmentio/kafka-go, publish a message whose value is larger than 1,024 bytes: writer := &kafkaio.Writer{ Addr: kafkaio.TCP("localhost:9092"), Topic: "input", } defer writer.Close() err := writer.WriteMessages( context.Background(), kafkaio.Message{Value: bytes.Repeat([]byte("A"), 1025)}, ) if err != nil { log.Fatal(err) } Expected result: the consumer process terminates with a panic containing invalid chunk byte size; BatchConsumeFn is not reached. Impact Denial of service against applications using this library in batch mode with a byte-size limit. An attacker needs permission to publish to the consumer’s Kafka topic. A poison record can keep the service in a crash loop if a supervisor restarts it. No confidentiality or integrity impact is expected.
来源⚠️ https://github.com/Trendyol/kafka-konsumer/security/advisories/GHSA-jjgw-p88q-qrxr
用户
 efek (UID 102374)
提交2026-10-23 04時39分 (26 日前)
管理2026-11-18 08時08分 (26 days later)
状态重复
VulDB条目432884 [Trendyol kafka-konsumer 直到 2.6.17 Batch Consumer batch_consumer.go 拒绝服务]
积分0

Do you want to use VulDB in your project?

Use the official API to access entries easily!