CVE-2021-43157

9.8 CRITICAL

📋 TL;DR

CVE-2021-43157 is a critical SQL injection vulnerability in Projectsworlds Online Shopping System PHP 1.0 that allows attackers to execute arbitrary SQL commands via the id parameter in cart_remove.php. This affects all users running the vulnerable version of this PHP-based e-commerce system. Successful exploitation could lead to complete database compromise.

💻 Affected Systems

Products:
  • Projectsworlds Online Shopping System PHP
Versions: Version 1.0
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: All installations of version 1.0 are vulnerable. The vulnerability exists in the cart_remove.php file.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full database compromise including theft of customer data, admin credentials, payment information, and potential remote code execution leading to complete system takeover.

🟠

Likely Case

Data exfiltration of user credentials, personal information, and order details, potentially leading to account takeover and fraud.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries preventing SQL injection.

🌐 Internet-Facing: HIGH - This is a web application vulnerability that can be exploited remotely without authentication.
🏢 Internal Only: MEDIUM - While primarily internet-facing, internal users could also exploit if they have access to the application.

🎯 Exploit Status

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

SQL injection via GET/POST parameter requires minimal technical skill. Public GitHub issues demonstrate the vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch exists. Replace vulnerable code with parameterized queries: 1. Locate cart_remove.php 2. Replace direct SQL concatenation with prepared statements 3. Validate and sanitize id parameter 4. Test functionality

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Add input validation to ensure id parameter contains only numeric values

// In cart_remove.php, add: if(!is_numeric($_GET['id'])) { die('Invalid input'); }

Web Application Firewall (WAF)

all

Deploy WAF with SQL injection rules to block malicious requests

🧯 If You Can't Patch

  • Isolate the vulnerable system behind a reverse proxy with strict input filtering
  • Implement network segmentation to limit database access from the web server

🔍 How to Verify

Check if Vulnerable:

Test cart_remove.php with SQL injection payloads like: cart_remove.php?id=1' OR '1'='1

Check Version:

Check PHP files for version comments or project documentation

Verify Fix Applied:

Attempt SQL injection tests after implementing parameterized queries and verify they fail

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in web server logs
  • Multiple requests to cart_remove.php with SQL syntax in parameters
  • Database error messages containing SQL fragments

Network Indicators:

  • HTTP requests to cart_remove.php with SQL injection patterns
  • Unusual database query patterns from web server IP

SIEM Query:

source="web_logs" AND uri="*cart_remove.php*" AND (param="*' OR*" OR param="*UNION*" OR param="*SELECT*" OR param="*--*" OR param="*;*" OR param="*/*")

🔗 References

📤 Share & Export