Gửi #1052957: Trendyol kafka-konsumer ⁠< 2.6.18⁠ Denial of Service (DoS)thông tin

tiêu đềTrendyol kafka-konsumer ⁠< 2.6.18⁠ Denial of Service (DoS)
Mô tả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.
Nguồn⚠️ https://github.com/Trendyol/kafka-konsumer/security/advisories/GHSA-jjgw-p88q-qrxr
Người dùng
 efek (UID 102374)
Đệ trình23/10/2026 04:39 (cách đây 26 ngày)
Kiểm duyệt18/11/2026 08:08 (26 days later)
Trạng tháiBản sao
Mục VulDB432884 [Trendyol kafka-konsumer đến 2.6.17 Batch Consumer batch_consumer.go Từ chối dịch vụ]
điểm0

Do you want to use VulDB in your project?

Use the official API to access entries easily!