/

CVE-2022-51028

Severity:

HIGH RISK

(8.2)

SQL Injection (CWE-89) in CmsEasy 7.7.5 SQL Endpoint

CVE-2022-51028

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized database access and potential data modification

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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 sql parameter 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 execsql endpoint and unexpected query patterns.
  • Apply policy checks that require parameterized database access and restrict public routes that perform database operations.

Sources

SourceLink
cn-sec.comcn-sec.com/archives/1580677.html
github.comgithub.com/PeiQi0/PeiQi-WIKI-Book/blob/main/docs/wiki/cms/CmsEasy/CmsEasy%20crossall_act.php%20SQL%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E.md
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/other/cmseasy-crossall-act-sqli.yaml
vulncheck.comvulncheck.com/advisories/cmseasy-7.7-5-20210919-unauthenticated-sql-injection-via-crossall-execsql

Frequently asked

questions

It may be exploitable remotely if the endpoint is reachable over the network. The described issue does not require authentication.

No account is required according to the description, but the attacker must be able to send a request to the vulnerable endpoint.

Use parameterized queries so input is handled as data, and avoid exposing SQL execution functionality through public endpoints.

Keep untrusted input separate from query structure, enforce least-privilege database access, and include static analysis and code review checks for unsafe query construction.

Find out what's already
exploitable in your codebase.