Summary
DataEase has a SQL injection vulnerability in the Chart Data Handler, where user-controlled operator input can influence SQL construction. A remote attacker who can reach the affected chart data functionality and supply the relevant input may be able to alter database queries; the consequences depend on the database account's permissions.
Affected context
The issue is in ExtWhere2Str.extWhere2sqlOjb in engine/trans/ExtWhere2Str.java, within DataEase's Chart Data Handler. Reported affected releases include versions up to 2.10.27 and 3.1.0. The risk arises when the handler builds SQL using a user-controlled compound operator without validating the complete operator.
Exploit preconditions
- Attack surface: The remotely reachable chart data handling functionality
- Required access: Ability to submit input that reaches the affected handler; whether authentication is required depends on the deployment and endpoint configuration
- Trigger point: Processing of the operator argument during SQL construction
- Why exploitation is possible: Untrusted operator logic can influence the generated SQL rather than being restricted to fixed, validated values
Why this happens
The underlying issue is that input used as SQL logic is incorporated into query construction without sufficiently validating the complete compound operator. This is a form of CWE-89: SQL Injection, and more broadly relates to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component. The reported fix pattern validates the entire operator and selects fixed AND or OR keywords instead of concatenating user-controlled logic into SQL.
Potential impact
- An attacker may be able to change the meaning of database queries
- Sensitive data could be exposed, depending on query access and database permissions
- Data could potentially be modified or deleted if the database account permits those operations
- Application availability or integrity could be affected by unauthorized database actions
General mitigation guidance
Defensive patterns focus on separating data from query structure and constraining any input that represents SQL logic.
- Use parameterized queries for data values rather than concatenating them into SQL.
- Represent allowed operators as a closed set of fixed choices, such as
ANDandOR, and validate the complete operator before query construction. - Reduce trust in client-supplied query controls and reject values that do not match the expected schema.
- Apply least-privilege permissions to database accounts and limit the operations available to chart-processing components.
- Keep query construction centralized so validation and safe SQL-generation rules are applied consistently.
How teams detect issues like this
- Use static analysis rules to identify SQL strings assembled from request data or other untrusted inputs.
- Review code paths that convert chart filters, operators, or other query controls into SQL, especially concatenation and dynamic clause construction.
- Enforce code-review or CI policies requiring parameterization for values and allowlisting for dynamic SQL keywords or operators.
- Monitor application and database logs for unexpected query structures, errors, or access patterns.
- Automated code review tools may help identify risky query-construction patterns.

