CVE-2025-6668

7.3 HIGH

📋 TL;DR

This critical SQL injection vulnerability in code-projects Inventory Management System 1.0 allows remote attackers to execute arbitrary SQL commands via the brandId parameter in /php_action/fetchSelectedBrand.php. This can lead to data theft, modification, or deletion. All users running the vulnerable version are affected.

💻 Affected Systems

Products:
  • code-projects Inventory Management System
Versions: 1.0
Operating Systems: All platforms running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations of version 1.0 with the vulnerable file present. No special configuration required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data exfiltration, data destruction, privilege escalation to system-level access, and potential lateral movement within the network.

🟠

Likely Case

Unauthorized access to sensitive inventory data, customer information theft, and potential data manipulation affecting business operations.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only allowing read access to non-sensitive data.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploit details are publicly available on GitHub and vuldb. Simple SQL injection techniques can be used.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

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

Restart Required: No

Instructions:

No official patch available. Consider upgrading to a newer version if available, or implement manual fixes as described in workarounds.

🔧 Temporary Workarounds

Input Validation and Parameterized Queries

all

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

Replace vulnerable SQL query with: $stmt = $conn->prepare('SELECT * FROM brands WHERE brand_id = ?'); $stmt->bind_param('i', $brandId); $stmt->execute();

WAF Rule Implementation

all

Deploy web application firewall rules to block SQL injection patterns targeting the brandId parameter.

Add WAF rule: SecRule ARGS:brandId "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQLi attempt detected'"

🧯 If You Can't Patch

  • Isolate the system from internet access and restrict network connectivity to only necessary internal services.
  • Implement strict database permissions, ensuring the application database user has minimal required privileges (preferably read-only for this endpoint).

🔍 How to Verify

Check if Vulnerable:

Test the /php_action/fetchSelectedBrand.php endpoint with SQL injection payloads like: brandId=1' OR '1'='1

Check Version:

Check the software version in admin panel or review source code files for version indicators.

Verify Fix Applied:

Test with the same SQL injection payloads after applying fixes - should return error or no data instead of executing SQL.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in PHP/application logs
  • Multiple rapid requests to fetchSelectedBrand.php with unusual parameters
  • Database queries containing SQL keywords like UNION, SELECT, FROM in brandId parameter

Network Indicators:

  • HTTP requests to /php_action/fetchSelectedBrand.php with SQL injection patterns in parameters
  • Unusual database traffic patterns from the application server

SIEM Query:

source="web_logs" AND uri_path="/php_action/fetchSelectedBrand.php" AND (query_string="*UNION*" OR query_string="*SELECT*" OR query_string="*OR '1'='1*")

🔗 References

📤 Share & Export