Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-12302

CVE-2025-12302: Simple Food Ordering System XSS Flaw

CVE-2025-12302 is a cross-site scripting vulnerability in Fabian Simple Food Ordering System 1.0 affecting the editproduct.php file. Attackers can exploit this remotely to inject malicious scripts. Learn the details.

Published:

CVE-2025-12302 Overview

CVE-2025-12302 is a cross-site scripting (XSS) vulnerability affecting code-projects Simple Food Ordering System 1.0. The flaw resides in the /editproduct.php file, where the pname, category, and price parameters accept unsanitized input. An attacker can inject script content through these parameters, which is later rendered in the browser context of any user who views the affected page. The vulnerability is remotely reachable over the network and requires user interaction to trigger. Public exploit details are already available, increasing the likelihood of opportunistic abuse against exposed instances.

Critical Impact

Attackers can inject arbitrary JavaScript into product management pages through unsanitized pname, category, or price parameters, enabling session token theft and administrative action hijacking on Simple Food Ordering System 1.0.

Affected Products

  • code-projects Simple Food Ordering System 1.0
  • Deployments referencing the vulnerable /editproduct.php endpoint
  • Any environment exposing the application to untrusted network users

Discovery Timeline

  • 2025-10-27 - CVE-2025-12302 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-12302

Vulnerability Analysis

The issue is classified under [CWE-79], improper neutralization of input during web page generation. The /editproduct.php script receives the pname, category, and price arguments and reflects or stores them without applying output encoding or contextual sanitization. When the page is subsequently rendered, the injected markup executes in the victim's browser under the origin of the vulnerable application.

Because the endpoint is part of product management functionality, an authenticated administrator is the most likely target audience for stored payloads. Session cookies, cross-site request forgery (CSRF) tokens, and any browser-accessible data become reachable to the attacker. The public availability of exploit details lowers the barrier for opportunistic use, though successful exploitation still depends on user interaction with the tampered content.

Root Cause

The root cause is the absence of input validation and output encoding around user-supplied product fields. The application concatenates parameter values directly into HTML responses without escaping characters such as <, >, ", and '. No allowlist or context-aware encoder (HTML, attribute, JavaScript) is applied before rendering.

Attack Vector

An attacker crafts a request to /editproduct.php and places JavaScript payloads inside the pname, category, or price parameters. The payload is stored or reflected and later executed when a user, typically a site administrator, loads the affected view. Delivery can occur through phishing links, social engineering, or by manipulating product entries an administrator would review.

No verified proof-of-concept code is published in the referenced sources. See the GitHub CVE Issue #21 and VulDB entry #329974 for reported reproduction details.

Detection Methods for CVE-2025-12302

Indicators of Compromise

  • HTTP requests to /editproduct.php containing <script>, onerror=, onload=, or javascript: substrings in the pname, category, or price parameters
  • Product records in the application database with HTML tags or JavaScript event handlers in name, category, or price fields
  • Outbound browser requests from administrative sessions to attacker-controlled hosts shortly after loading product pages

Detection Strategies

  • Deploy web application firewall (WAF) rules that inspect POST and GET traffic to /editproduct.php for XSS signatures
  • Enable browser Content Security Policy (CSP) violation reporting to surface script execution from unexpected origins
  • Perform periodic database scans for stored product entries containing angle brackets or scripting keywords

Monitoring Recommendations

  • Log full request bodies for administrative PHP endpoints and forward them to a centralized analytics platform for pattern matching
  • Alert on authenticated administrator sessions that generate anomalous outbound requests immediately after product page loads
  • Track repeated edits to the same product record originating from different IP addresses or user agents

How to Mitigate CVE-2025-12302

Immediate Actions Required

  • Restrict network access to /editproduct.php to trusted administrative IP ranges until a fix is deployed
  • Audit existing product entries for injected HTML or JavaScript and sanitize or remove affected records
  • Force password resets and session invalidation for all administrative accounts on exposed instances

Patch Information

No vendor patch is referenced in the available advisories. Consult the Code Projects resource and the VulDB CTI ID #329974 tracker for updates. Until an official fix is released, apply application-layer input validation and output encoding directly in /editproduct.php for the pname, category, and price fields.

Workarounds

  • Wrap all reflected parameter output with an HTML-context encoder such as PHP's htmlspecialchars($value, ENT_QUOTES, 'UTF-8')
  • Enforce a strict Content Security Policy that disallows inline scripts and unknown script sources
  • Validate price as numeric only and constrain pname and category to alphanumeric characters plus a small allowlist of punctuation
  • Place the application behind a WAF configured with OWASP Core Rule Set XSS protections
bash
# Example Apache configuration to restrict /editproduct.php by source IP
<Location "/editproduct.php">
    Require ip 10.0.0.0/24
    Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'"
    Header always set X-XSS-Protection "1; mode=block"
    Header always set X-Content-Type-Options "nosniff"
</Location>

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.