Skip to main content
CVE Vulnerability Database

CVE-2024-6216: Food Ordering System SQL Injection Flaw

CVE-2024-6216 is a critical SQL injection vulnerability in SourceCodester Food Ordering Management System 1.0 affecting the add-users.php file. Attackers can exploit this remotely to manipulate databases. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

CVE-2024-6216 Overview

CVE-2024-6216 is a SQL injection vulnerability in SourceCodester Food Ordering Management System 1.0. The flaw resides in the add-users.php script, where the contact parameter is passed to a database query without proper sanitization. An authenticated remote attacker can manipulate the parameter to inject arbitrary SQL statements. The issue is tracked publicly as VulDB entry VDB-269280 and maps to CWE-89. The exploit details have been disclosed publicly, increasing the risk of opportunistic attacks against exposed installations.

Critical Impact

An authenticated attacker can inject SQL through the contact parameter of add-users.php, enabling unauthorized read or modification of the application database.

Affected Products

  • Oretnom23 (SourceCodester) Food Ordering Management System 1.0
  • Deployments using the unmodified add-users.php component
  • Web hosts exposing the admin user-management interface to untrusted networks

Discovery Timeline

  • 2024-06-21 - CVE-2024-6216 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in the NVD database

Technical Details for CVE-2024-6216

Vulnerability Analysis

The vulnerability is a classic SQL injection [CWE-89] in the administrative user-creation workflow of the Food Ordering Management System. The add-users.php endpoint accepts a contact field from the HTTP request and concatenates it directly into an SQL statement. Because the input is not parameterized or escaped, attacker-supplied SQL syntax alters the query structure at execution time.

Exploitation requires network access to the application and low-privileged authentication to reach the add-users.php handler. Successful injection can expose user records, credentials, and order data, or allow attackers to modify database contents. Because the exploit has been publicly disclosed, mass scanning against exposed installations is likely.

Root Cause

The root cause is improper neutralization of special elements in an SQL command. The contact argument is inserted into a query string without prepared statements, parameter binding, or input validation, allowing user input to be interpreted as query logic.

Attack Vector

The attack vector is network-based. An attacker sends a crafted HTTP request to add-users.php with a malicious payload in the contact parameter. Public exploit descriptions have been published; see the GitHub SQLi exploit write-up and the VulDB entry #269280 for reproduction details.

No verified exploitation code is republished here. Refer to the linked advisories for the sanitized proof-of-concept.

Detection Methods for CVE-2024-6216

Indicators of Compromise

  • HTTP POST requests to add-users.php containing SQL metacharacters such as single quotes, UNION SELECT, --, or SLEEP( inside the contact parameter.
  • Web server logs showing unusually long or URL-encoded values submitted to the contact field.
  • Unexpected new administrator accounts created through the user-management interface.
  • Database error messages surfaced in HTTP responses that reference SQL syntax.

Detection Strategies

  • Deploy web application firewall signatures that inspect POST bodies to add-users.php for SQL injection tokens.
  • Correlate authenticated admin sessions with anomalous parameter payload lengths and character distributions.
  • Baseline query patterns in the backend database and alert on unusual SELECT or UNION activity originating from the application user.

Monitoring Recommendations

  • Enable verbose access logging on the web server for all requests to /add-users.php and archive logs to a centralized store.
  • Monitor database audit trails for schema enumeration queries against information_schema tables.
  • Track failed and successful admin logins that immediately precede requests to user-management endpoints.

How to Mitigate CVE-2024-6216

Immediate Actions Required

  • Restrict access to the /add-users.php endpoint using network ACLs or reverse-proxy rules until a fix is in place.
  • Rotate credentials for all administrator accounts and any database service accounts used by the application.
  • Review the users table for unauthorized entries created since deployment.
  • Enable a web application firewall rule set to block SQL injection payloads targeting the contact parameter.

Patch Information

No vendor patch is referenced in the NVD entry or the linked advisories. Because the Food Ordering Management System 1.0 is distributed as source code from SourceCodester, operators should apply a manual code fix: replace inline SQL concatenation in add-users.php with parameterized queries using PDO or mysqli prepared statements, and validate the contact field against an expected character set.

Workarounds

  • Place the admin interface behind VPN or IP allow-lists so unauthenticated internet users cannot reach add-users.php.
  • Apply a WAF rule that rejects requests where the contact parameter contains SQL keywords or non-numeric characters.
  • Run the application database account with least privilege, removing DROP, ALTER, and cross-database SELECT rights.
  • If the application is not required for production use, take it offline until the input handling is rewritten.

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.