CVE-2022-32333

7.2 HIGH

📋 TL;DR

Fast Food Ordering System v1.0 contains a SQL injection vulnerability in the receipt.php admin endpoint that allows attackers to execute arbitrary SQL commands. This affects all deployments of this specific software version. Attackers can potentially access, modify, or delete database content through this vulnerability.

💻 Affected Systems

Products:
  • Fast Food Ordering System
Versions: v1.0
Operating Systems: Any OS running PHP with database backend
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations of v1.0 regardless of configuration. Requires PHP and database backend (likely MySQL/MariaDB).

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including theft of sensitive data (customer information, payment details, admin credentials), data destruction, or full system takeover via privilege escalation.

🟠

Likely Case

Unauthorized data access including customer records, order history, and potentially admin credentials stored in the database.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only allowing data reading from specific tables.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is accessible via web interface and requires no authentication, making it easily exploitable from the internet.
🏢 Internal Only: MEDIUM - If system is only internally accessible, risk is reduced but still significant due to potential insider threats or lateral movement.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Public proof-of-concept exists in GitHub repository. Exploitation requires no authentication and uses simple SQL injection techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

No official patch available. Consider upgrading to a newer version if available, or implement workarounds.

🔧 Temporary Workarounds

Input Validation and Parameterized Queries

all

Modify receipt.php to use prepared statements with parameterized queries instead of direct string concatenation

Replace vulnerable code with: $stmt = $conn->prepare('SELECT * FROM sales WHERE id = ?'); $stmt->bind_param('i', $_GET['id']); $stmt->execute();

Web Application Firewall (WAF) Rules

all

Implement WAF rules to block SQL injection patterns targeting the vulnerable endpoint

ModSecurity rule: SecRule ARGS_GET:id "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQLi attempt detected'"

🧯 If You Can't Patch

  • Implement network segmentation to restrict access to the admin interface to trusted IP addresses only
  • Deploy a web application firewall (WAF) with SQL injection detection rules in front of the application

🔍 How to Verify

Check if Vulnerable:

Test the endpoint with SQL injection payload: /ffos/admin/sales/receipt.php?id=1' OR '1'='1

Check Version:

Check PHP files for version comments or look at application interface footer

Verify Fix Applied:

Test with same payload after fix - should return error page or no data instead of executing SQL

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple requests to receipt.php with special characters in id parameter
  • Database query errors containing user input

Network Indicators:

  • HTTP requests to /ffos/admin/sales/receipt.php with SQL keywords in parameters
  • Unusual database connection patterns from web server

SIEM Query:

source="web_logs" AND uri_path="/ffos/admin/sales/receipt.php" AND (param_id CONTAINS "'" OR param_id CONTAINS "OR" OR param_id CONTAINS "UNION")

🔗 References

📤 Share & Export