Summary
SSCMS v7.4.0 contains a SQL injection flaw in the stl:sqlContent tag where the queryString attribute is sent directly to the database without parameterization or sanitization.
By sending crafted (encrypted) payloads to the /api/stl/actions/dynamic endpoint, an attacker can execute arbitrary SQL, which may result in unauthorized access, data disclosure, authentication bypass, or full database compromise.
Affected context
The vulnerability appears in SSCMS deployments that:
- Use the
stl:sqlContenttag to dynamically run SQL based on thequeryStringattribute - Expose the
/api/stl/actions/dynamicendpoint for dynamic content rendering or actions - Accept user-controlled or indirectly controllable values that flow into
queryString - Execute database commands without consistent use of prepared statements or robust input validation
Risk is higher where this endpoint is reachable from untrusted networks or integrated with user-driven content.
Exploit preconditions
- Attack surface: HTTP(S) interface via the
/api/stl/actions/dynamicendpoint - Required access: Ability to send requests to this API (may be authenticated or unauthenticated, depending on deployment configuration)
- Input control: Capability to influence or construct the encrypted payload such that it controls the
queryStringvalue forstl:sqlContent - Trigger point: Execution of the
stl:sqlContenttag which passesqueryStringdirectly to the database execution layer - Why exploitation is possible: The SQL statement is built using untrusted data without parameterization, escaping, or robust server-side validation, enabling an attacker to alter query structure and logic.
Why this happens
The root cause is unsafe construction and execution of SQL statements that embed untrusted input from the queryString attribute.
Instead of using parameterized queries or prepared statements, the application constructs raw SQL text and sends it directly to the database engine.
This pattern is a classic instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where user-controlled data is treated as part of the SQL command itself, allowing it to modify query behavior.
Potential impact
- Unauthorized reading of sensitive data from application tables
- Modification or deletion of records, including content or configuration data
- Authentication bypass by altering login or session-related queries
- Creation of new administrative accounts or escalation of existing privileges at the application level
- Disruption of service through destructive operations such as dropping tables or locking critical resources
- Potential pivot to underlying host or other systems if database functions (e.g., file or network APIs) are enabled and abused
General mitigation guidance
Effective mitigation focuses on eliminating direct string-based SQL construction and reducing trust in any client-controlled input:
- Refactor dynamic SQL usage to rely on parameterized queries or prepared statements, ensuring that data values cannot alter query structure
- Introduce a server-side query builder or abstraction layer for
stl:sqlContentthat only allows whitelisted operations and fields instead of free-form SQL text - Enforce strict input validation and canonicalization on parameters that influence SQL, limiting them to expected formats, ranges, and known-safe values
- Apply least-privilege database accounts, restricting what the application's database user can read or modify, so that injected queries are constrained
- Consider disabling or limiting dynamic SQL tags in contexts exposed to untrusted users, or gating them behind additional authorization and review
- Centralize SQL execution patterns so that secure defaults (parameterization, escaping, validation) are consistently applied.
How teams detect issues like this
Detection typically combines code-centric and behavior-centric approaches:
- Static analysis: Use rules or tools that flag string concatenation or interpolation used to build SQL queries, especially where values originate from HTTP requests or template attributes like
queryString - Code review: Look for dynamic SQL tags such as
stl:sqlContentand verify that all their inputs are parameterized and validated; pay attention to ad-hoc SQL execution helpers - Logging and monitoring: Monitor database logs and application logs for anomalous query patterns (e.g., presence of comment markers, UNION clauses, or unexpected conditions) originating from the dynamic endpoint
- WAF/RAAS policies: Deploy web application firewall rules to detect and block common SQL injection patterns, while recognizing that obfuscation or encryption layers may require deeper inspection
- Security tests: Regularly run automated and manual penetration tests focused on dynamic query endpoints to validate that injection attempts are rejected or safely handled.

