Summary
A critical SQL injection vulnerability in the Super Diamond Server preview interface allows attacker-controlled module values to influence a database query.
When the affected endpoint is reachable and a crafted request is processed, an attacker may read, alter, or interfere with database operations beyond the intended preview function.
Affected context
The issue affects Super Diamond Server deployments using the /superdiamond/preview/{projectCode}/{module}/{type} interface in versions up to and including 1.3.3. The risk exists when the module path parameter reaches query construction through string splitting and concatenation, without being safely parameterized or constrained to an approved set of values.
Exploit preconditions
- Attack surface: The HTTP front-end preview endpoint
- Required access: Network access to a reachable Super Diamond Server instance; authentication requirements depend on deployment configuration
- Trigger point: Processing of the
modulepath parameter during construction of a SQLINclause - Why exploitation is possible: User-controlled input is concatenated into SQL rather than passed through parameter binding or an equivalent safe query abstraction
Why this happens
The vulnerability is caused by constructing part of a SQL statement through direct string concatenation after processing the module parameter with StringUtils.split().
This insecure pattern treats request data as SQL syntax instead of strictly separating data from executable query structure. It maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection).
Potential impact
- An attacker may retrieve unauthorized database records
- An attacker could modify or delete database data
- The vulnerability may enable authentication or authorization bypass, depending on query use
- Database availability could be disrupted
- Exposed database credentials or excessive service privileges could increase downstream impact
General mitigation guidance
Mitigation generally focuses on removing string-built SQL and reducing trust in request parameters.
Common defensive patterns include:
- Use parameterized queries, prepared statements, or safe query-builder APIs for all dynamic values
- Represent
IN-clause values using supported bind-parameter mechanisms rather than concatenated text - Validate
moduleagainst a strict allowlist of permitted identifiers - Apply input validation after parsing and before query construction
- Run the application with a narrowly scoped database account
- Restrict database permissions and separate read-only preview operations where feasible
- Avoid exposing detailed SQL errors or database metadata to clients
How teams detect issues like this
Organizations can look for SQL injection risks through:
- Static analysis rules identifying string concatenation or interpolation in SQL construction
- Code review checks for request parameters used in query fragments, especially
INclauses - Tests that verify parameters are bound rather than embedded in generated SQL
- Web application firewall or API policy rules monitoring suspicious query syntax in path parameters
- Database audit logs showing unexpected statements, access patterns, or privilege use
- Automated security review tools that flag unsafe query-building APIs and missing allowlist validation

