Skip to content

Validate Cassandra keyspace/table identifiers (CQL-injection defense-in-depth) #1026

Closed

Description

@AmitoVrito

Summary

Defense-in-depth (not currently runtime-exploitable — the values are developer-controlled, not user/document input): CassandraVectorStore interpolates keyspace / table_name directly into CQL statements without validation or quoting:

  • src/synapsekit/retrieval/cassandra_vector.py:140,149,163,192

Every other SQL-backed vector store in the repo validates or escapes its identifiers. This is a consistency/hardening gap: if a keyspace/table name ever becomes config- or user-derived, it's a CQL-injection sink.

Severity

LOW — defense-in-depth / consistency; no untrusted input reaches it today.

Fix (non-breaking)

Validate keyspace/table_name against a strict identifier allowlist (^[A-Za-z_][A-Za-z0-9_]*$) at construction time, raising ValueError on anything else — matching the sibling stores. Values are data-controlled, so valid names are unaffected.

Acceptance

  • Regression test: a keyspace/table with a quote/semicolon/space is rejected at construction; valid identifiers accepted.
  • CHANGELOG [Unreleased] Security entry.

Activity

  1. added
    bug
    security
    on Sep 8, 2026
  2. added a commit that references this issue on Sep 8, 2026
  3. added a commit that references this issue on Sep 12, 2026
    74fc429
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions