/

CVE-2026-33121

Severity:

HIGH RISK

(8.8)

SQL Injection in DataEase Datasource Saving API

CVE-2026-33121

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution and Data Exposure

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 flaw in the API that saves datasource configurations, where the deTableName field is interpolated directly into a DDL statement.

An authenticated attacker who can create or modify datasource configurations may craft a malicious table name to execute arbitrary SQL, enabling error-based extraction of database information such as the MySQL version.

Affected context

This vulnerability occurs in DataEase deployments that:

  • Use versions 2.10.20 or earlier
  • Allow authenticated users to create or update datasource configurations through the API
  • Construct DDL statements using deTableName directly from the Base64-encoded configuration payload
  • Execute the resulting SQL against a MySQL (or compatible) database with typical application-level privileges

In this context, the table name is treated as trusted input and is not sanitized or parameterized before being incorporated into dynamic SQL.

Exploit preconditions

  • Attack surface: HTTP(S) API endpoint responsible for saving datasource configurations.
  • Required access: Valid authenticated account with permissions to create or edit datasource configurations.
  • Trigger point: Submission of a crafted datasource configuration where the Base64-encoded deTableName field contains SQL metacharacters designed to escape identifier quoting.
  • Why exploitation is possible: The application constructs a DDL statement using simple string replacement, embedding deTableName directly into the SQL without parameterization, quoting discipline, or server-side validation, allowing attacker-controlled fragments to alter the intended SQL structure.

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Instead of treating deTableName as untrusted input that must be strictly validated and safely incorporated into SQL, the code performs raw string concatenation or replacement to assemble a DDL statement.

Because no robust identifier validation, escaping, or parameterization is applied, an attacker can inject SQL control characters and additional clauses that change the semantics of the query, leading to error-based SQL injection and arbitrary SQL execution within the scope of the application's database credentials.

Potential impact

  • Extraction of database metadata (e.g., MySQL version, current database, table names, column names)
  • Unauthorized reading of sensitive application data through injected SELECT statements (depending on error behavior and query context)
  • Modification or deletion of tables and records via injected DDL/DML statements (DROP, ALTER, UPDATE, DELETE)
  • Creation of new tables or objects that may assist further compromise or persistence
  • Potential escalation of impact to other tenants or datasets if the application uses a shared database schema

General mitigation guidance

Effective mitigation centers on removing direct string interpolation of untrusted input into SQL and tightening trust boundaries:

  • Use parameterized queries or prepared statements wherever possible, even for DDL operations, and avoid constructing SQL via manual concatenation.
  • Apply strict server-side validation to all identifier-like fields (such as table names), enforcing allowed character sets and patterns and rejecting unexpected tokens or SQL metacharacters.
  • Introduce a mapping or whitelisting layer between user-facing identifiers and actual database objects, so user input never directly controls raw SQL identifiers.
  • Limit the database privileges of the application account to the minimal set required, reducing the blast radius of any injected statements.
  • Centralize SQL construction logic and enforce a secure-by-default API for query building to prevent ad-hoc string-based SQL assembly in business code.

How teams detect issues like this

Detection can combine code-level analysis with runtime monitoring:

  • Static analysis: Configure SAST rules to flag dynamic SQL construction where user-controlled values (such as request body fields) are concatenated into queries, especially around DDL operations or identifier fields.
  • Code review: During manual review, look for:
  • Queries built using string concatenation, interpolation, or template replacement.
  • Use of unvalidated configuration fields in SQL identifiers (table names, column names).
  • Lack of centralized query builders or parameterization wrappers.
  • Runtime monitoring: Enable database logging (e.g., general query logs or audit logs) to detect anomalous statements, such as unexpected DDL from application accounts or queries containing user-supplied patterns.
  • Security testing: Incorporate automated and manual SQL injection tests into CI/CD pipelines for all API endpoints that persist or interpret configuration data.

Sources

SourceLink
github.comgithub.com/dataease/dataease/releases/tag/v2.10.21
github.comgithub.com/dataease/dataease/security/advisories/GHSA-fg4m-q7ch-jqv5

Frequently asked

questions

Yes. Any actor who can reach the DataEase API endpoint for saving datasource configurations and authenticate successfully can attempt to exploit this vulnerability over the network.

It requires an authenticated account with the ability to create or modify datasource configurations. Additional database-level impact depends on the privileges assigned to the application's database user.

Replace all string-based SQL assembly involving deTableName with parameterized or framework-backed query construction, and enforce strict validation for identifier fields to ensure only expected characters and formats are allowed.

Adopt a defensive development baseline: mandate parameterized queries, centralize SQL building in vetted utility layers, perform thorough input validation on any data that influences SQL structure, and add static analysis plus security-focused code review to your development workflow.

Find out what's already
exploitable in your codebase.