제출 #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. AM 04:39 (26 날 ago)
모더레이션2026. 11. 18. AM 08:08 (26 days later)
상태중복
VulDB 항목432884 [Trendyol kafka-konsumer 까지 2.6.17 Batch Consumer batch_consumer.go 서비스 거부]
포인트들0

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!