CVE-2021-43157
📋 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
- Projectsworlds Online Shopping System PHP
📦 What is this software?
Online Shopping System by Projectworlds
⚠️ 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.
🎯 Exploit Status
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
allAdd 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)
allDeploy 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
- https://github.com/projectworldsofficial/online-shopping-webvsite-in-php/issues/1
- https://projectworlds.in/free-projects/php-projects/free-download-online-shopping-system/
- https://github.com/projectworldsofficial/online-shopping-webvsite-in-php/issues/1
- https://projectworlds.in/free-projects/php-projects/free-download-online-shopping-system/