CVE-2026-40900: Verified Reproduction
CVE-2026-40900: DataEase: stacked-query SQL injection via previewSql with allowMultiQueries
CVE-2026-40900 is verified against dataease · github. Affected versions: <= v2.10.20. Fixed in v2.10.21. Vulnerability class: SQLi. This high reproduction includes runnable sandbox proof, artifacts, and a plain-text agent view under REPRO-2026-00169.
What Is CVE-2026-40900?
CVE-2026-40900 is a high-severity (CVSS 8.8 per the advisory) stacked-query SQL injection vulnerability (CWE-89) in DataEase's previewSql endpoint, letting an attacker execute arbitrary stacked SQL statements against the application database. Pruva reproduced it (reproduction REPRO-2026-00169).
CVE-2026-40900 Severity & CVSS Score
CVE-2026-40900 is rated high severity, with a CVSS base score of 8.8 out of 10.
High — serious impact or readily exploitable. Prioritize remediation.
Affected dataease Versions
dataease · github versions <= v2.10.20 are affected.
How to Reproduce CVE-2026-40900
pruva-verify REPRO-2026-00169 curl -O https://www.pruva.dev/api/v1/reproductions/REPRO-2026-00169/artifacts/bundle/repro/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh Proof of Reproduction for CVE-2026-40900
- Vulnerable
v2.10.20 - Fixed
v2.10.21
How the agent worked
Root Cause and Exploit Chain for CVE-2026-40900
CVE-2026-40900 is a stacked-query SQL injection vulnerability in DataEase's previewSql endpoint (POST /de2api/datasetData/previewSql). The endpoint accepts arbitrary user-supplied SQL and wraps it inside a subquery (SELECT * FROM ( <USER_SQL> ) AS alias LIMIT 100) without enforcing that the input is a single SELECT statement. When the underlying MySQL JDBC connection is configured with allowMultiQueries=true, an attacker can craft a payload that escapes the wrapping subquery using a closing parenthesis and semicolon, executes a second side-effecting statement (INSERT/UPDATE/DELETE), and uses a MySQL # comment to swallow the remainder of the wrapper. This grants full read/write access to the application database.
- Package/component affected: DataEase (
io.dataease:datasource:type:Mysqlanddataset:manage:DatasetDataManage) - Affected versions:
<= v2.10.20 - Fixed versions:
v2.10.21 - Risk level: High (CVSS 3.1: 8.8)
- Consequences: Authenticated attacker can execute arbitrary stacked SQL against the DataEase application database, including INSERT/UPDATE/DELETE on tables such as
core_msg_typeor Quartz scheduler tables, enabling further privilege escalation or RCE as documented in the Ox Security writeup.
Root Cause
The vulnerability has two contributing factors:
Missing
allowMultiQueriesin MySQL JDBC parameter blocklist: Incore/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java(v2.10.20), theillegalParameterslist did not includeallowMultiQueries. This allowed an admin (or attacker who had compromised admin privileges via the preceding CVEs in the chain) to register a MySQL datasource whose JDBC URL containedallowMultiQueries=true.No single-statement validation in
previewSql:DatasetDataManage.previewSql()wraps the user-provided SQL string in a subquery without parsing or validating that it is a single SELECT statement. WhenallowMultiQueries=true, the MySQL JDBC driver happily executes multiple statements in one call.
The attacker payload:
SELECT 1 FROM dual) AS x; INSERT INTO repro_test (id, name) VALUES (999999999, 'pwned')#
becomes:
SELECT * FROM ( SELECT 1 FROM dual) AS x; INSERT INTO repro_test ... # ) AS alias LIMIT 100
The # comments out ) AS alias LIMIT 100, leaving two valid statements, both of which MySQL executes.
Fix commit: 15611593b3631b5a25528b9cdb2ee517ef27929a — adds "allowMultiQueries" to the illegalParameters list in Mysql.java. When the datasource configuration is validated during save/update, JdbcUrlSecurityPolicy.validate() now rejects any MySQL JDBC URL or extra parameters containing allowMultiQueries, causing the datasource to be saved with status="Error". previewSql refuses to run against datasources with Error status, blocking the exploit path.
Reproduction Steps
See repro/reproduction_steps.sh for the automated end-to-end reproduction. At a high level:
- Start DataEase
v2.10.20+ MySQL via Docker Compose. - Log in as
admin/DataEase@123456(RSA-encrypted credentials fetched via/de2api/dekey). - Create a MySQL datasource with
extraParams=allowMultiQueries=true. - Validate the datasource (succeeds on v2.10.20).
- Send
POST /de2api/datasetData/previewSqlwith a base64-encoded stacked-SQL payload:SELECT 1 FROM dual) AS x; INSERT INTO repro_test (id, name) VALUES (999999999, 'pwned-by-cve-2026-40900')# - Query MySQL: a new row exists in
repro_test— proving the INSERT executed. - Tear down, redeploy with
v2.10.21, repeat the same save request. - On v2.10.21 the datasource is saved but marked
status="Error"becauseallowMultiQueriesis rejected by the updatedillegalParametersblocklist.previewSqlrefuses to run, and no side-effect occurs.
Evidence
logs/v2.10.20_exploit.json— HTTP response frompreviewSqlon the vulnerable build.logs/v2.10.20_validate.json— datasource validation response showingstatus="Success".logs/v2.10.21_create_datasource.json— save response on the fixed build showingstatus="Error".- Console output from the reproduction script shows:
- v2.10.20:
Post-exploit repro_test count: 1 - v2.10.21: datasource unusable,
count: 0
- v2.10.20:
Recommendations / Next Steps
- Upgrade to v2.10.21 or later — the vendor patch is minimal and targeted.
- Additional defense-in-depth: add a server-side SQL parser (e.g., JSqlParser or Calcite SQL validation) to enforce that
previewSqlinput contains exactly one SELECT statement before wrapping it. - Audit existing MySQL datasources for any that have
allowMultiQueries=truein their configuration and remove or reconfigure them. - Regression test: include the stacked-SQL payload in the CI pipeline for
previewSqlto ensure future changes don't re-introduce the bypass.
Additional Notes
- Idempotency: The script was run twice consecutively, both times producing the same results (vulnerable side-effect confirmed on v2.10.20, blocked on v2.10.21).
- Limitations: The reproduction requires running the full DataEase Spring Boot container and MySQL container, so each run takes ~60–90 seconds. The script handles cleanup automatically via
trap cleanup EXIT. - The fix is in the datasource configuration layer (
Mysql.illegalParameters) rather than in thepreviewSqlquery-wrapping logic itself. While this blocks the specificallowMultiQueriesvector, a more robust fix would also validate the SQL structure inpreviewSqlto defend against other JDBC-parameter bypasses.
CVE-2026-40900 Reproduction Transcript
The agent's step-by-step process — every tool call, every handoff, the moment the exploit fired.
Full session Replay every step — scrub the timeline or play it back.
Unknown error
Unknown error
Unknown error
Artifacts and Evidence for CVE-2026-40900
Scripts, logs, diffs, and output captured during the reproduction.
How to Fix CVE-2026-40900
Upgrade dataease · github to v2.10.21 or later.
FAQ: CVE-2026-40900
How does the CVE-2026-40900 exploit work?
SELECT 1 FROM dual) AS x; INSERT INTO core_msg_type (id, name, pid) VALUES (999999999,'pwned-by-cve-2026-40900',0)#. The closing parenthesis and semicolon escape the wrapping subquery, the INSERT executes as a second stacked statement, and the trailing # comments out the rest of the wrapper.Which versions of DataEase are affected by CVE-2026-40900, and where is it fixed?
How severe is CVE-2026-40900?
How can I reproduce CVE-2026-40900?
References for CVE-2026-40900
Authoritative sources for CVE-2026-40900 — official vulnerability databases and the upstream advisory. Pruva's reproduction verifies the issue firsthand; these are the primary records to corroborate it.