CVE-2025-0176

6.3 MEDIUM

📋 TL;DR

This critical SQL injection vulnerability in code-projects Point of Sales and Inventory Management System 1.0 allows remote attackers to execute arbitrary SQL commands via the id/qty parameters in /user/add_cart.php. This can lead to data theft, system compromise, or complete database takeover. All users running version 1.0 without proper input validation are affected.

💻 Affected Systems

Products:
  • code-projects Point of Sales and Inventory Management System
Versions: 1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations of version 1.0 with the vulnerable /user/add_cart.php endpoint accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise allowing data exfiltration, privilege escalation, system takeover, and potential lateral movement to connected systems.

🟠

Likely Case

Unauthorized data access, modification or deletion of POS/inventory data, potential financial loss, and business disruption.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and network segmentation preventing database access.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Public exploit available in GitHub gist, simple SQL injection requiring minimal technical skill to execute.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: https://code-projects.org/

Restart Required: No

Instructions:

No official patch available. Consider migrating to alternative software or implementing custom fixes with parameterized queries and input validation.

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side validation to sanitize id and qty parameters before processing

Modify /user/add_cart.php to validate numeric inputs: if(!is_numeric($_POST['id']) || !is_numeric($_POST['qty'])) { die('Invalid input'); }

Web Application Firewall Rule

all

Block SQL injection patterns targeting add_cart.php endpoint

WAF rule: deny requests to /user/add_cart.php containing SQL keywords in parameters

🧯 If You Can't Patch

  • Isolate the system on internal network with no internet access
  • Implement strict network segmentation and database firewall rules

🔍 How to Verify

Check if Vulnerable:

Test /user/add_cart.php endpoint with SQL injection payloads in id or qty parameters and observe database errors or unexpected behavior.

Check Version:

Check system documentation or admin panel for version information

Verify Fix Applied:

Attempt SQL injection after implementing fixes and confirm proper error handling without database exposure.

📡 Detection & Monitoring

Log Indicators:

  • Unusual database queries from web server
  • SQL syntax errors in application logs
  • Multiple rapid requests to /user/add_cart.php

Network Indicators:

  • HTTP requests to /user/add_cart.php with SQL keywords in parameters
  • Unusual database traffic patterns

SIEM Query:

source="web_logs" AND uri="/user/add_cart.php" AND (param="id" OR param="qty") AND (content="UNION" OR content="SELECT" OR content="INSERT" OR content="DELETE")

🔗 References

📤 Share & Export