CVE-2025-51970
Executive Summary
CVE-2025-51970 is a critical SQL Injection vulnerability in the PuneethReddyHC Online Shopping System Advanced 1.0, specifically within the action.php endpoint. The flaw arises from improper sanitization of the keyword POST parameter, allowing an unauthenticated attacker to inject arbitrary SQL commands. This can lead to full database compromise, including extraction of user credentials, order data, and administrative access. No official patch has been released, and the vendor has not responded to disclosure attempts. The vulnerability is remotely exploitable with no authentication required, making it a high-priority threat for any instance of this software exposed to the internet.
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
- 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 is the only one affected.
- Confidentiality (C): High (H) – Full database read access.
- Integrity (I): High (H) – Data can be modified or deleted.
- Availability (A): High (H) – Database can be disrupted or destroyed.
CVSS Score: 9.8 (Critical)
Threat Level: Critical – Immediate action required for any exposed instance.
Deep Dive & Mechanics
The vulnerability resides in the action.php file, which handles user actions such as search, login, and product queries. The keyword parameter is directly concatenated into SQL queries without parameterization or escaping. For example, a typical search query might be:
$sql = "SELECT * FROM products WHERE name LIKE '%" . $_POST['keyword'] . "%'";
An attacker can break out of the string context by injecting a single quote (') and then append arbitrary SQL. The lack of input validation allows for UNION-based, error-based, or blind SQL injection techniques.
Attack Flow:
- Attacker sends a POST request to
action.phpwith a craftedkeywordparameter. - The injected SQL modifies the query logic, e.g.,
' OR '1'='1' -- -to bypass authentication or' UNION SELECT ... -- -to extract data. - The database returns results that are reflected in the application response, enabling data exfiltration.
Impact:
- Full read/write access to the database.
- Extraction of admin credentials (likely stored in plaintext or weak hashes).
- Potential for remote code execution via
INTO OUTFILEor stored procedures if database permissions allow.
Vulnerable vs. Patched Code
Vulnerable Code (action.php):
<?php
$keyword = $_POST['keyword'];
$query = "SELECT * FROM products WHERE name LIKE '%$keyword%'";
$result = mysqli_query($conn, $query);
?>
Patched Code (Recommended):
<?php
$keyword = mysqli_real_escape_string($conn, $_POST['keyword']);
$query = "SELECT * FROM products WHERE name LIKE '%$keyword%'";
$result = mysqli_query($conn, $query);
?>
Better Practice (Parameterized Query):
<?php
$stmt = $conn->prepare("SELECT * FROM products WHERE name LIKE CONCAT('%', ?, '%')");
$stmt->bind_param("s", $_POST['keyword']);
$stmt->execute();
$result = $stmt->get_result();
?>
The vulnerable code directly interpolates user input, while the patched version uses escaping or prepared statements to neutralize injection attempts.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Environment:
- Target: PuneethReddyHC Online Shopping System Advanced 1.0 running on Apache/PHP/MySQL.
- Attacker: Kali Linux with
sqlmapandcurl.
Manual Exploitation:
# Test for injection
curl -X POST http://target/action.php -d "keyword=test' OR '1'='1' -- -"
# Extract database version
curl -X POST http://target/action.php -d "keyword=' UNION SELECT @@version,2,3 -- -"
Automated Exploitation with sqlmap:
sqlmap -u "http://target/action.php" --data="keyword=test" --batch --dump-all
Expected Output:
- Database name, tables, and records (e.g., admin credentials, orders).
Blue Team (Defensive)
Detection Steps:
- Monitor web server logs for POST requests to
action.phpcontaining SQL keywords (UNION,SELECT,OR,--). - Deploy a Web Application Firewall (WAF) rule to block suspicious
keywordparameters. - Review database logs for anomalous queries (e.g.,
UNION SELECT).
Honeypot Setup:
- Deploy a decoy instance of the vulnerable application and log all POST data to
action.phpfor threat intelligence.
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/action.phpwithkeywordparameter containing SQL metacharacters (',--,UNION,SELECT). - Outbound database connections from the web server to unexpected IPs (data exfiltration).
File IOCs:
- Modified
action.phpfile (if attacker uploads a webshell). - Suspicious files in the web root (e.g.,
cmd.php,shell.php).
Log IOCs:
- Apache access logs showing repeated POST requests to
action.phpwith varyingkeywordvalues. - MySQL general log showing queries with
UNION SELECTorINTO OUTFILE.
Detection Engineering
YARA Rule
rule CVE_2025_51970_SQLi_Keyword {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-51970 in action.php"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-51970"
strings:
$sqli1 = /keyword=.*['\"]\s*(OR|AND|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|--|#)/i
$sqli2 = /keyword=.*\b(1=1|1=2|admin'|' OR '1'='1)\b/i
condition:
any of them
}
Sigma Rule
title: SQL Injection Attempt Against action.php (CVE-2025-51970)
id: 8a3f7c2e-5d1b-4a9f-8c6e-2b1d3f4a5c6e
status: experimental
description: Detects SQL injection attempts in POST requests to action.php
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/action.php'
cs-uri-query|contains: 'keyword='
keywords:
- "' OR '1'='1"
- "' UNION SELECT"
- "' -- -"
- "1=1--"
condition: selection and keywords
falsepositives:
- Legitimate search queries containing SQL-like strings (rare)
level: high
Suricata Rule
alert http any any -> $EXTERNAL_NET any (
msg:"CVE-2025-51970 SQL Injection Attempt in action.php";
flow:to_server,established;
content:"POST"; http_method;
content:"/action.php"; http_uri;
content:"keyword="; http_client_body;
pcre:"/(\x27|\x22)\s*(OR|AND|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|--)/i";
sid:1000001;
rev:1;
reference:cve,2025-51970;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Isolate the vulnerable system from the internet until a patch is applied.
- Implement input validation for the
keywordparameter: allow only alphanumeric characters and spaces. - Apply a virtual patch using a WAF (e.g., ModSecurity rule to block SQL keywords in POST data).
Long-Term Fix:
- Replace all dynamic SQL queries with parameterized prepared statements.
- Upgrade to a secure version of the shopping system or migrate to a supported platform.
Compromise Assessment:
- Check database logs for unauthorized queries.
- Review web server logs for exploitation attempts.
- Rotate all credentials stored in the database.
Valters IT Signature
This report was generated by Valters IT Cyber Threat Intelligence Division. For questions, contact intel@valtersit.com.
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.