CVE-2025-59390 Overview
Apache Druid's Kerberos authenticator contains an insecure random number generation vulnerability that occurs when the druid.auth.authenticator.kerberos.cookieSignatureSecret configuration is not explicitly set. In this scenario, the secret used to sign authentication cookies is generated using ThreadLocalRandom, which is not a cryptographically secure random number generator. This weakness may allow attackers to predict or brute force the secret, potentially enabling token forgery or authentication bypass across Apache Druid deployments.
Critical Impact
This vulnerability enables attackers to potentially forge authentication cookies or bypass authentication entirely in Apache Druid clusters using Kerberos authentication. Additionally, the inconsistent secret generation across nodes can cause authentication failures in distributed or multi-broker deployments.
Affected Products
- Apache Druid versions through 34.0.0
- Apache Druid deployments using Kerberos authentication without explicitly configured cookieSignatureSecret
- Distributed or multi-broker Apache Druid clusters with default Kerberos configurations
Discovery Timeline
- 2025-11-26 - CVE-2025-59390 published to NVD
- 2025-12-04 - Last updated in NVD database
Technical Details for CVE-2025-59390
Vulnerability Analysis
The vulnerability stems from the use of ThreadLocalRandom for generating fallback secrets in Apache Druid's Kerberos authenticator. When administrators do not explicitly configure the druid.auth.authenticator.kerberos.cookieSignatureSecret property, the system falls back to an automatically generated secret. However, the implementation uses ThreadLocalRandom, a pseudo-random number generator designed for performance in concurrent applications rather than security purposes.
This design flaw creates two significant security issues. First, the predictable nature of ThreadLocalRandom means attackers with sufficient knowledge of the system state may be able to predict or brute force the generated secret value. Second, because each Druid process generates its own independent fallback secret, distributed deployments experience inconsistent secrets across nodes, leading to authentication failures when requests are routed to different brokers.
Root Cause
The root cause is classified as CWE-338 (Use of Cryptographically Weak Pseudo-Random Number Generator). The Kerberos authenticator component in Apache Druid relies on ThreadLocalRandom to generate the cookie signature secret when no explicit configuration is provided. Unlike cryptographically secure random number generators such as SecureRandom, ThreadLocalRandom uses algorithms that prioritize speed over unpredictability, making its output potentially predictable to sophisticated attackers.
Attack Vector
The attack vector is network-based and requires no prior authentication or user interaction. An attacker could exploit this vulnerability by:
- Analyzing the predictable patterns in ThreadLocalRandom output
- Attempting to predict or brute force the cookie signature secret
- Forging valid authentication cookies using the discovered secret
- Bypassing authentication to gain unauthorized access to the Apache Druid cluster
The vulnerability mechanism involves the weak random number generation used for cookie signature secrets. When the druid.auth.authenticator.kerberos.cookieSignatureSecret is not explicitly configured, Apache Druid's Kerberos authenticator generates a fallback secret using ThreadLocalRandom. This pseudo-random number generator is not designed for cryptographic purposes and produces predictable output that could be exploited by attackers. For technical implementation details, refer to the Apache Security Mailing List Thread.
Detection Methods for CVE-2025-59390
Indicators of Compromise
- Unusual authentication cookie patterns or malformed authentication tokens in access logs
- Multiple authentication failures followed by successful access from the same source
- Unexpected access to Apache Druid resources by previously unauthorized users
- Inconsistent authentication behavior across different nodes in distributed deployments
Detection Strategies
- Review Apache Druid configuration files to verify explicit druid.auth.authenticator.kerberos.cookieSignatureSecret settings
- Monitor authentication logs for anomalous patterns suggesting cookie forgery attempts
- Implement network traffic analysis to detect potential brute force attempts against authentication endpoints
- Audit access patterns for unauthorized queries or administrative actions
Monitoring Recommendations
- Enable detailed authentication logging in Apache Druid to capture all Kerberos authentication events
- Set up alerts for repeated authentication failures from single IP addresses
- Monitor for configuration drift that might remove explicit secret configurations
- Implement security information and event management (SIEM) rules to correlate authentication anomalies
How to Mitigate CVE-2025-59390
Immediate Actions Required
- Explicitly configure a strong, cryptographically random druid.auth.authenticator.kerberos.cookieSignatureSecret in all Apache Druid instances
- Ensure the same secret is configured consistently across all nodes in distributed deployments
- Rotate any existing authentication sessions after implementing the configuration change
- Upgrade to Apache Druid version 35.0.0 or later as soon as possible
Patch Information
Apache has released version 35.0.0 which addresses this vulnerability by making it mandatory to explicitly set the druid.auth.authenticator.kerberos.cookieSignatureSecret configuration when using the Kerberos authenticator. Services will fail to start if the secret is not configured, preventing deployments from running with insecure default settings. Refer to the Apache Security Mailing List Thread for official patch details.
Workarounds
- Generate a cryptographically secure random secret using tools like openssl rand -base64 32
- Configure the generated secret explicitly in the druid.auth.authenticator.kerberos.cookieSignatureSecret property
- Distribute the same secret to all nodes in your Apache Druid cluster to ensure consistent authentication
- Consider implementing additional network-level access controls to limit exposure while patching
# Generate a cryptographically secure secret for Apache Druid Kerberos configuration
openssl rand -base64 32
# Add the generated secret to your Apache Druid common.runtime.properties file
# druid.auth.authenticator.kerberos.cookieSignatureSecret=<your-generated-secret>
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

