Summary
CmsEasy 7.7.5_20210919 has an unauthenticated SQL injection in the execsql_action endpoint, where attacker-supplied SQL is decrypted using a hardcoded key and executed. A reachable vulnerable endpoint may allow an attacker to read database contents, including administrator usernames and password hashes.
Affected context
The issue occurs in the /?case=crossall&act=execsql endpoint when the execsql_action function processes the sql parameter. The described behavior involves decrypting and executing supplied queries with a hardcoded key. Exposure depends on whether the endpoint is reachable in the deployed application; exploitation evidence was observed by the Shadowserver Foundation on 2023-10-22.
Exploit preconditions
- Attack surface: The CmsEasy SQL execution endpoint must be reachable by the attacker.
- Required access: The vulnerability is described as unauthenticated; no valid account is required.
- Trigger point: A request supplies a crafted
sqlparameter to/?case=crossall&act=execsql. - Why exploitation is possible: The function decrypts attacker-controlled input using a hardcoded key and executes the resulting SQL without adequately preventing SQL injection.
Why this happens
The underlying bug is SQL injection, mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command. The application treats externally supplied data as executable query content rather than keeping it separate from SQL structure. Decrypting input with a hardcoded key does not make that input trustworthy or prevent injected query logic.
Potential impact
- An attacker may read database records, including administrator usernames and password hashes.
- An attacker could modify or delete data, depending on the database account's permissions.
- Exposed credentials or sensitive records may enable further compromise.
- Database availability could be affected if destructive or resource-intensive queries are permitted.
General mitigation guidance
Defensive patterns focus on separating data from query structure and reducing the authority of database operations:
- Use parameterized queries or prepared statements instead of constructing executable SQL from request data.
- Avoid exposing database query execution functionality through unauthenticated endpoints.
- Treat decrypted or encoded input as untrusted; encryption or obfuscation does not replace validation.
- Apply strict input constraints and allow only explicitly supported operations.
- Limit database account privileges to the minimum required and restrict access to sensitive records.
How teams detect issues like this
- Use static analysis to identify query construction that incorporates request parameters or decrypted values.
- Review code for database execution functions reachable from unauthenticated routes.
- Monitor application and database logs for unusual requests to the
execsqlendpoint and unexpected query patterns. - Apply policy checks that require parameterized database access and restrict public routes that perform database operations.

