/

CVE-2019-25573

Severity:

HIGH RISK

(7.1)

SQL Injection in Green CMS 2.x Admin Posts Module

CVE-2019-25573

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Query Execution and Data Exposure

Severity:

HIGH RISK

(7.1)

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

Green CMS 2.x contains an SQL injection vulnerability in the admin posts listing functionality, where the cat parameter is used unsafely in database queries.

An authenticated attacker can inject arbitrary SQL through crafted GET requests to index.php and execute database queries that may expose or manipulate sensitive data.

Affected context

This vulnerability occurs in Green CMS 2.x within the administrative interface, specifically in the posts management module (m=admin, c=posts, a=index).

It affects deployments where:

  • Administrators or other authenticated users can access the posts listing page via HTTP(S)
  • The cat parameter from GET requests is used to filter posts
  • The application directly concatenates or interpolates this parameter into SQL queries without robust parameterization or sanitization

Exploit preconditions

  • Attack surface: HTTP GET endpoint at index.php with parameters m=admin, c=posts, a=index
  • Required access: Valid authenticated session with access to the admin posts index page
  • User-controlled input: The cat query parameter supplied via the URL
  • Trigger point: Server-side execution of a database query that embeds cat directly into the SQL statement
  • Why exploitation is possible: The application constructs SQL using string concatenation or unsafe interpolation instead of using prepared statements or parameterized queries, allowing attacker-controlled input to alter the query structure

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

User-supplied data from the cat parameter is treated as trusted and directly incorporated into an SQL query, often via string concatenation or similarly unsafe patterns.

Because there is no strict boundary between data and code in the query, special characters such as quotes, operators, or SQL keywords can break out of the intended context, enabling attackers to modify the query logic, append additional commands, or bypass filters.

Potential impact

  • Unauthorized reading of sensitive data from one or more database tables
  • Extraction of user details, including potentially hashed passwords, email addresses, and configuration settings
  • Modification or deletion of content, posts, or other stored records
  • Creation of new administrative or privileged accounts at the database level if application logic permits
  • Potential stepping stone to broader compromise if combined with other weaknesses (e.g., reuse of credentials, weak admin passwords)

General mitigation guidance

Effective mitigation focuses on separating SQL code from user input and constraining what queries can do:

  • Use parameterized queries or prepared statements for all database access, ensuring user input is always treated as data, not code
  • Apply strict server-side validation on the cat parameter (e.g., whitelisting numeric IDs or specific category identifiers)
  • Centralize database access in a data access layer that enforces safe query construction patterns by default
  • Implement least-privilege database accounts so that the application can only perform the minimum required operations (e.g., read-only when appropriate)
  • Consider using an ORM or query builder that encourages safe parameter binding and discourages raw string concatenation

How teams detect issues like this

Detection typically involves both code-centric and runtime approaches:

  • Static analysis: Configure tools or custom rules to detect dynamic SQL construction involving request parameters (e.g., $GET['cat'] or equivalent) without parameter binding
  • Code review: Look for direct string concatenation in SQL-related code paths in the admin posts module and other controllers handling query parameters
  • Security testing: Use automated scanners or manual testing to send crafted input in the cat parameter and observe for SQL error messages, anomalous responses, or data leakage
  • Database monitoring: Monitor for unusual or complex queries originating from the CMS application account, such as UNION-heavy or system-table access patterns that deviate from typical usage

Sources

SourceLink
greencms.netgreencms.net/
codeload.github.comcodeload.github.com/GreenCMS/GreenCMS/zip/beta
exploit-db.comexploit-db.com/exploits/46244
vulncheck.comvulncheck.com/advisories/green-cms-2-x-sql-injection-via-cat-parameter

Frequently asked

questions

Yes. Any attacker who can reach the admin interface over the network and has valid credentials can exploit the vulnerability by sending crafted GET requests.

Yes. Exploitation requires an authenticated user account with access to the admin posts index endpoint. The exact role needed depends on how Green CMS permissions are configured.

The most robust fix is to refactor all affected queries to use parameterized statements or prepared queries, combined with strict validation of the cat parameter to ensure it matches expected formats (such as numeric IDs or predefined category keys).

Adopt a development policy that forbids dynamic SQL built from user input, enforce the use of safe database access abstractions, integrate static analysis into CI to flag insecure patterns, and perform regular security-focused code reviews of request handlers and database interaction layers.

Find out what's already
exploitable in your codebase.