/

CVE-2026-28438

Severity:

CRITICAL RISK

(9.8)

SQL Injection in CocoIndex Doris Target Connector Table

CVE-2026-28438

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution on Doris Target Database

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CocoIndex's Doris target connector previously constructed ALTER TABLE statements using unvalidated table names, allowing SQL injection when those names originated from untrusted upstream input.

In deployments where upstream systems can influence the target table name, an attacker could craft values that alter or drop arbitrary tables, manipulate schema, or otherwise compromise the underlying Doris database.

Affected context

This vulnerability arises in CocoIndex deployments that use the Doris target connector and dynamically derive the target table name from upstream sources, such as configuration, user-controlled metadata, or external services.

It is most relevant when schema changes are triggered automatically (e.g., during migrations or dynamic schema alignment) and ALTER TABLE SQL statements are built directly from these table names without validation or proper identifier handling.

Exploit preconditions

  • Attack surface: The Doris target connector's schema change path, specifically ALTER TABLE operations.
  • Required access: Ability to influence or control the configured table name field used by CocoIndex (e.g., through upstream configuration, API input, or pipeline metadata).
  • Trigger point: Execution of a schema change that causes CocoIndex to generate and run ALTER TABLE statements using the attacker-controlled table name.
  • Why exploitation is possible: The connector interpolates the table name directly into SQL without treating it as a bounded identifier, performing input validation, or using safe identifier-quoting APIs, enabling injection of additional SQL fragments.

Why this happens

The underlying bug is a classic CWE-89: SQL Injection issue where untrusted data is concatenated into SQL statements.

Instead of treating the table name as an opaque identifier and validating or constraining it, the Doris connector directly interpolates the configured table name into ALTER TABLE statements at runtime.

This pattern bypasses the separation between data and code in the SQL layer, allowing attacker-controlled values to modify the intended SQL syntax and execute arbitrary commands within the same database session.

Potential impact

  • Attackers could alter or drop arbitrary Doris tables accessible to the connector.
  • Data in target tables can be corrupted, truncated, or restructured unexpectedly.
  • Unauthorized schema changes could destabilize downstream analytics or AI pipelines.
  • In some configurations, attackers may escalate impact by chaining injected statements to manipulate permissions or exfiltrate sensitive data.

General mitigation guidance

Mitigation efforts generally focus on enforcing strict boundaries between untrusted input and SQL construction, especially for identifiers such as table names:

  • Constrain table names to a known safe set wherever possible (e.g., configuration-based mapping or whitelisting).
  • Apply strict validation to identifier-like inputs: allow only expected patterns (e.g., alphanumeric plus underscores) and reject anything else.
  • Use safe identifier-quoting mechanisms or ORM/query builder features that treat identifiers as opaque values rather than raw string fragments.
  • Separate configuration trust levels so that table naming is not directly influenced by user-supplied or low-trust metadata.
  • Apply least-privilege to the Doris account used by CocoIndex, limiting its ability to modify unrelated schemas or tables.

How teams detect issues like this

Organizations can detect and monitor this class of flaw using a combination of code-level and operational techniques:

  • Static analysis: Flag string concatenation used to build SQL statements, especially where identifiers and keywords are assembled from external or dynamic inputs.
  • Code review: Look for custom SQL-building logic in connectors, particularly around DDL operations (ALTER TABLE, CREATE TABLE) that use variables for table or column names without validation.
  • Logging and monitoring: Enable detailed SQL logging in staging or controlled environments to spot anomalous or multi-statement ALTER TABLE queries derived from unexpected table names.
  • Policy enforcement: Incorporate secure coding rules into CI pipelines that disallow ad-hoc SQL string construction for schema changes when safer abstractions or validation utilities are available.

Sources

SourceLink
github.comgithub.com/cocoindex-io/cocoindex/commit/ba2fc4a89e22d35572c64bd2990737c7913b0729
github.comgithub.com/cocoindex-io/cocoindex/security/advisories/GHSA-59g6-v3vg-f7wc

Frequently asked

questions

It can be, if remote clients or external services can influence the table name that CocoIndex uses for the Doris connector. The exploitability depends on how the surrounding application exposes table-selection or metadata configuration.

An attacker must be able to control or significantly influence the value used as the target table name—typically through upstream configuration, metadata, or any integration point that feeds table identifiers into CocoIndex.

The most robust fix is to stop constructing SQL by concatenating untrusted strings and instead enforce a strict mapping or whitelist for table names, coupled with strong validation and safe identifier handling when building SQL statements.

Adopt a development policy that forbids raw SQL concatenation with untrusted data, favors parameterization and safe identifier APIs, enforces validation for all identifier-like inputs, and integrates automated checks for SQL construction patterns into the review and CI process.

Find out what's already
exploitable in your codebase.