/

CVE-2026-33207

Severity:

HIGH RISK

(8.8)

SQL Injection in DataEase getTableField Endpoint

CVE-2026-33207

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution and Data Exfiltration

Severity:

HIGH RISK

(8.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

DataEase versions 2.10.20 and below contain a SQL injection vulnerability in the /datasource/getTableField endpoint, where the tableName parameter is directly interpolated into query strings without parameterization.

An authenticated attacker who can register a crafted API datasource may execute arbitrary SQL commands, enabling error-based extraction of sensitive information from the underlying database.

Affected context

This vulnerability appears in DataEase deployments using versions 2.10.20 and below, specifically when the /datasource/getTableField endpoint is exposed and API datasources can be registered by authenticated users.

The issue occurs in the Java backend (CalciteProvider.getTableFiledSql) where the tableName is incorporated into SQL via String.format instead of parameterized queries.

While DatasourceServer attempts to validate that the table exists in the datasource, the design allows registration of API datasources whose table names can be attacker-controlled, enabling a malicious table name to pass validation and reach the vulnerable SQL construction.

Exploit preconditions

  • Attack surface: HTTP interface of the DataEase backend, specifically the /datasource/getTableField endpoint.
  • Required access: Valid authenticated access with permissions to register or configure an API datasource, and to invoke the affected endpoint.
  • Trigger point: Invocation of /datasource/getTableField after registering an API datasource whose deTableName (tableName) contains crafted SQL content.
  • Why exploitation is possible: The backend uses string concatenation (String.format) to embed tableName directly into SQL without parameter binding or robust sanitization. The existing validation only checks that the table name appears in the datasource metadata, which can be influenced by the attacker by first registering a malicious datasource, thereby bypassing the intended safeguard.

Why this happens

The root cause is reliance on dynamic SQL string construction using untrusted input without parameterization, a classic instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

In CalciteProvider.getTableFiledSql, the tableName parameter is inserted into the SQL query via String.format, allowing attacker-controlled content to alter the query structure rather than being treated as a data value.

The architecture further assumes that table-name validation in DatasourceServer is sufficient to enforce safety, but because datasource registration accepts user-controlled table names, the attacker can influence the value that ultimately flows into the SQL builder.

This combination of unsafe query construction and insufficient trust boundaries between configuration metadata and runtime SQL execution leads to arbitrary SQL command execution in the database context used by DataEase.

Potential impact

  • Extraction of sensitive data from application tables, including user records, configuration data, or analytics content.
  • Error-based enumeration of database schema, tables, columns, and privileges.
  • Modification or deletion of data, potentially corrupting dashboards, reports, or analytics results.
  • Abuse of database-level functions and stored procedures, which may expand to broader system impact depending on database configuration.
  • Privilege escalation within the database if the application account holds elevated permissions.

General mitigation guidance

Effective mitigation focuses on eliminating direct string-based SQL composition and tightening trust boundaries around datasource metadata:

  • Use parameterized queries: Replace String.format and other concatenation patterns with prepared statements or framework-level query builders that treat incoming values as parameters, not SQL syntax.
  • Constrain identifiers: When dynamic table names are unavoidable, restrict them to a vetted allowlist or use strict identifier validation (e.g., matching only against known names and enforcing a restricted character set) rather than trusting user-registered metadata.
  • Separate configuration from execution: Avoid allowing tenant or user-controlled configuration (such as datasource registrations) to directly influence SQL identifiers without an intermediate normalization or mapping layer.
  • Apply least privilege to the database account: Ensure the database user used by DataEase has only the minimal required privileges, limiting the blast radius if injection occurs.
  • Centralize query construction rules: Encapsulate SQL generation patterns in a shared module or data access layer that enforces parameterization and safe identifier handling by default.

How teams detect issues like this

Detection can be approached at both code and runtime levels:

  • Static analysis: Use SAST tools or custom rules to flag instances of SQL construction that concatenate user-derived values or use format strings instead of parameter bindings. Searches for patterns like String.format("...%s...", tableName) in data access code are particularly relevant.
  • Code review cues: During peer review, treat any dynamic SQL generation, especially involving identifiers such as table or column names, as a high-risk pattern that must be justified and constrained. Verify that datasource registration cannot introduce unchecked identifiers into query builders.
  • Runtime monitoring: Enable application and database logging to capture unusual or malformed queries, particularly those containing SQL keywords where only identifiers are expected. Correlate access logs for /datasource/getTableField with database error logs for repeated or anomalous errors.
  • Policy enforcement in CI/CD: Integrate automated checks to block merges when unsafe SQL construction patterns are detected, and require security sign-off for changes to datasource management or query-building components.

Sources

SourceLink
github.comgithub.com/dataease/dataease/releases/tag/v2.10.21
github.comgithub.com/dataease/dataease/security/advisories/GHSA-pgh3-rgw3-xjmm

Frequently asked

questions

Yes, it is exploitable over the network through the DataEase HTTP API, but only by clients that can authenticate and access the relevant datasource management and /datasource/getTableField functionality.

The described attack path assumes an authenticated user who can register an API datasource and invoke the vulnerable endpoint. The exact role required depends on how roles and permissions are configured in a given deployment.

The core fix pattern is to stop interpolating attacker-controllable values into SQL strings and instead use parameterized queries or safe query-building abstractions. Additionally, treat datasource metadata as untrusted input, enforcing strict allowlists or controlled mappings for any values that influence SQL identifiers.

Adopt a development standard that forbids direct string concatenation in SQL, centralize data access through a vetted layer that enforces parameterization, and include targeted security reviews for all code that constructs dynamic queries or interacts with datasource configuration. Regular static analysis and security-focused code review help catch regressions early.

Find out what's already
exploitable in your codebase.