Missing Authentication in Cassandra
How Missing Authentication Manifests in Cassandra
Missing authentication in Cassandra environments typically appears through several distinct attack vectors that exploit the database's default configuration and network architecture. The most common manifestation occurs when Cassandra instances are deployed with default settings that enable anonymous access, allowing any client to connect without credentials.
Default Cassandra installations bind to all network interfaces (0.0.0.0) and enable the AllowAllAuthenticator, which accepts any username/password combination. Attackers exploit this by simply connecting to the native transport port (9042) or Thrift port (9160) and executing arbitrary CQL commands. This grants immediate access to read, modify, or delete any data in the cluster.
Another critical manifestation involves misconfigured Cassandra drivers in application code. When developers fail to implement proper authentication in their connection strings, applications may connect to Cassandra using default credentials or no credentials at all. This creates a security gap where the application layer trusts the database connection without verification, allowing attackers who compromise the application to gain unrestricted database access.
Cassandra's multi-datacenter architecture introduces additional authentication risks. When cross-datacenter replication is enabled without proper authentication, attackers can exploit the gossip protocol or internode communication channels to inject malicious data or disrupt cluster operations. The lack of mutual authentication between nodes allows compromised nodes to poison the cluster's state.
Real-world exploitation often involves automated scanning tools that identify Cassandra instances with open ports. Once discovered, attackers execute commands like:
cqlsh -u cassandra -p cassandra 192.168.1.100This connects using the default superuser credentials, granting full administrative privileges. From there, attackers can enumerate keyspaces, dump sensitive data, or install persistence mechanisms.
The consequences extend beyond data exposure. Missing authentication enables ransomware attacks where attackers encrypt data and demand payment for decryption keys. It also facilitates data exfiltration for competitive intelligence or regulatory violations when personal data is exposed without proper controls.
Cassandra-Specific Detection
Detecting missing authentication in Cassandra requires both network-level scanning and application-level analysis. Network scanning focuses on identifying exposed Cassandra instances and testing their authentication mechanisms. Tools like nmap can discover open ports 9042 and 9160, while specialized scanners probe for default credentials and anonymous access.
middleBrick's API security scanner includes specific checks for authentication vulnerabilities in database management interfaces and data access endpoints. When scanning Cassandra-related APIs, middleBrick tests for unauthenticated access to administrative functions, data retrieval endpoints, and configuration interfaces. The scanner attempts connections without credentials and analyzes response patterns to identify authentication bypasses.
For application-level detection, static code analysis tools examine database connection strings and configuration files for missing authentication parameters. Look for patterns like:
// Vulnerable: missing authentication
Cluster cluster = Cluster.builder()
.addContactPoint(Related CWEs: authentication
| CWE ID | Name | Severity |
|---|---|---|
| CWE-287 | Improper Authentication | CRITICAL |
| CWE-306 | Missing Authentication for Critical Function | CRITICAL |
| CWE-307 | Brute Force | HIGH |
| CWE-308 | Single-Factor Authentication | MEDIUM |
| CWE-309 | Use of Password System for Primary Authentication | MEDIUM |
| CWE-347 | Improper Verification of Cryptographic Signature | HIGH |
| CWE-384 | Session Fixation | HIGH |
| CWE-521 | Weak Password Requirements | MEDIUM |
| CWE-613 | Insufficient Session Expiration | MEDIUM |
| CWE-640 | Weak Password Recovery | HIGH |