Horizon Alert
Summary of the vulnerability and why it matters
This advisory addresses a critical vulnerability in Kafka Streams that can cause applications to become unresponsive. The issue arises from a timestamp calculation error that, under specific conditions, leads to an infinite loop, halting processing. While the Streams application is affected, not the entire Kafka cluster, a single malformed record can trigger this stall, and the problem can persist even after restarts. Access to a source topic with write privileges and specific broker configurations are needed to exploit this.
- A calculation error can freeze Kafka Streams applications.
- Unresponsive applications may require manual intervention.
- Confirm relevance to internal data processing.
Attack Path
How an attacker could exploit the issue
An attacker could target a Kafka Streams application by sending a specially crafted record to a source topic. This record's timestamp, when processed by the vulnerable `PunctuationSchedule.next()` function, causes an integer overflow. The overflowed negative time then causes the processing thread to repeatedly re-queue the same time, indefinitely stalling the thread and making the application unresponsive.
- Requires write access to a source topic.
- Triggered by record timestamp near Long.MAX_VALUE.
- Application becomes unresponsive.
Live Threat
Current exploitation, exposure, and threat context
A record with a timestamp near the maximum value for a 64-bit integer could cause a Kafka Streams application to enter an infinite loop, causing it to stop processing data and become unresponsive. This issue can persist even after restarting the application if the problematic record remains in the source topic. The Streams application, not the Kafka brokers or cluster, is the sole affected component.
- Unresponsive Streams applications.
- Record triggers infinite processing loop.
- Application stops functioning entirely.
Operational Fix
Recommended remediation, mitigation, and detection steps
This vulnerability affects Kafka Streams applications, specifically the StreamThread responsible for processing records and punctuation. Application owners and platform teams are likely responsible for managing Kafka Streams deployments. The first practical step is to identify all Kafka Streams applications, confirm which ones use stream-time punctuation, and assess if they are impacted by records with timestamps near `Long.MAX_VALUE` and if their source topics are reachable with potentially disallowed timestamps.
- Identify affected Kafka Streams applications.
- Verify topic write access and timestamps.
- Plan remediation based on exposure.