Średnia

cassandra-jdbc-wrapper: Authentication Token Exposed in Logs

  • Ujawniono: 19.11.2026
  • Aktualizacja: 19.11.2026 04:17

Summary

The fix for AIKIDO-2024-10565 (plaintext password logging) introduced two redaction helpers — DriverUtil.toStringWithoutSensitiveValues() and DriverUtil.redactSensitiveValuesInJdbcUrl() — but both helpers only redact the "password" property/parameter (JdbcUrlUtil.TAG_PASSWORD). The equally sensitive "token" property (JdbcUrlUtil.TAG_TOKEN), used for DataStax Astra and other token-based Cassandra authentication, is completely unredacted by both helpers. Applications using token-based authentication with DEBUG logging enabled will therefore log the live authentication token in plaintext via SessionHolder's calls to these same two helpers — the exact same exposure pattern that the original fix was intended to prevent.

Details

File: src/main/java/com/ing/data/cassandra/jdbc/utils/DriverUtil.java

java
// toStringWithoutSensitiveValues (lines 341-347) -- only redacts "password"
public static String toStringWithoutSensitiveValues(final Properties properties) {
    final Properties withRedactedSensitiveValues = (Properties) properties.clone();
    if (withRedactedSensitiveValues.containsKey(TAG_PASSWORD)) {
        withRedactedSensitiveValues.setProperty(TAG_PASSWORD, "***");
    }
    return withRedactedSensitiveValues.toString();
}

// redactSensitiveValuesInJdbcUrl (lines 355-378) -- only redacts "password"
final String redactedQuery = Arrays.stream(...)
    .map(param -> {
        if (param.startsWith(TAG_PASSWORD + "=")) {
            return TAG_PASSWORD + "=***";
        }
        return param;     // <-- "token=..." passes through unmodified
    })
    ...

JdbcUrlUtil.java defines TAG_TOKEN = "token" (line 407) as a separate, distinct connection property used when connecting with DataStax Astra-style token-based authentication. Neither redaction helper checks for this key.

File: src/main/java/com/ing/data/cassandra/jdbc/SessionHolder.java

Both helpers are called on connection-level properties at DEBUG log level:

java
// Line 150 — logs all connection properties including "token" unredacted
log.debug("Final Properties to Connection: {}",
    toStringWithoutSensitiveValues(this.properties));

// Lines 173, 190 — logs JDBC URL including "?token=..." unredacted
final String jdbcUrl = redactSensitiveValuesInJdbcUrl(this.cacheKey.get(URL_KEY));
log.debug("Released last reference to {}, closing Session.", jdbcUrl);
log.debug("Acquired reference to {}, new count = {}.", jdbcUrl, ref + 1);

DEBUG logging is commonly enabled in production troubleshooting and staging environments, meaning the token is logged in plain text every time a connection is acquired or released in such environments.

PoC

Environment: JDK 17+, Maven 3.x

pom.xml dependency:

xml
<dependency>
    <groupId>com.ing.data</groupId>
    <artifactId>cassandra-jdbc-wrapper</artifactId>
    <version>5.0.1</version>
</dependency>

Exploit.java:

java
import com.ing.data.cassandra.jdbc.utils.DriverUtil;
import java.util.Properties;

public class Exploit {
    public static void main(String[] args) throws Exception {
        String secretToken = "AstraCS:SUPER_SECRET_TOKEN_VALUE_1234567890";

        // Test 1: redactSensitiveValuesInJdbcUrl()
        String urlWithToken = "jdbc:cassandra://host:9042/ks?token=" + secretToken;
        String redacted = DriverUtil.redactSensitiveValuesInJdbcUrl(urlWithToken);
        System.out.println("Token in 'redacted' URL: " + redacted.contains(secretToken)); // true

        // Test 2: toStringWithoutSensitiveValues()
        Properties props = new Properties();
        props.setProperty("token", secretToken);
        String redactedProps = DriverUtil.toStringWithoutSensitiveValues(props);
        System.out.println("Token in 'redacted' props: " + redactedProps.contains(secretToken)); // true

        // Control: password IS correctly redacted
        Properties propsWithPassword = new Properties();
        propsWithPassword.setProperty("password", "secret");
        System.out.println("Password redacted: " +
            !DriverUtil.toStringWithoutSensitiveValues(propsWithPassword).contains("secret")); // true
    }
}

Result (confirmed, 3/3 reproductions on cassandra-jdbc-wrapper 5.0.1, the latest release):

Token in 'redacted' URL:   true   <- token leaks through the URL redactor
Token in 'redacted' props: true   <- token leaks through the property redactor
Password redacted:         true   <- password IS correctly masked (control)

The "redacted" output for a token-based connection string is byte-for-byte identical to the unredacted original — the helpers have no effect on token.

Impact

Vulnerability type: Insertion of Sensitive Information into Log File (CWE-532).

An authentication token (functionally equivalent in sensitivity to a password — it grants full access to the Cassandra cluster) is written in plaintext to application log files whenever:

  • The application uses token-based authentication (e.g., DataStax Astra), AND
  • DEBUG logging is enabled (common in staging environments and during production troubleshooting sessions).

An attacker who can read log files — via log aggregation system access, misconfigured log storage, or a separate log-reading vulnerability — can extract a live authentication token and use it to authenticate directly to the Cassandra cluster, accessing all data the token is authorized to read or write.

This is exactly the same impact class as the original AIKIDO-2024-10565 fix was intended to prevent — the fix simply missed a second sensitive credential type that was already present in the codebase.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Java / Kotlin (Maven) com.ing.data:cassandra-jdbc-wrapper >= 5.0.0, < 5.0.2, < 4.16.4 5.0.2, 4.16.4

Odnośniki

Ocena CVSS 5.5/10
Wektor CVSS
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Słabość (CWE)
CWE-532
Platforma
Java / Kotlin (Maven)
Paczka
com.ing.data:cassandra-jdbc-wrapper
Ujawniono
19.11.2026
Aktualizacja
19.11.2026 04:17

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-jc42-994r-vvwp - CC BY 4.0

Historia podatności: com.ing.data:cassandra-jdbc-wrapper

Wszystkie opisane podatności tej paczki (Java / Kotlin (Maven)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

To jedyna znana podatność tej paczki.

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.