CVE-2021-46061

9.8 CRITICAL

📋 TL;DR

This CVE describes a critical SQL injection vulnerability in the Computer and Mobile Repair Shop Management System (RSMS) 1.0. Attackers can exploit the 'code' parameter in the /rsms/ node application to execute arbitrary SQL commands, potentially compromising the entire database. Organizations using RSMS 1.0 are affected.

💻 Affected Systems

Products:
  • Sourcecodester Computer and Mobile Repair Shop Management System (RSMS)
Versions: 1.0
Operating Systems: Any OS running the RSMS web application
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation. No special configuration is required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, data destruction, authentication bypass, and potential remote code execution on the underlying server.

🟠

Likely Case

Unauthorized access to sensitive customer and repair data, including personal information, financial records, and business operations data.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database permissions restricting the application account.

🌐 Internet-Facing: HIGH - The vulnerability affects a web application that is typically internet-facing, allowing remote exploitation without authentication.
🏢 Internal Only: MEDIUM - If the application is only accessible internally, 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 code is available in GitHub repositories. The exploit requires minimal technical skill due to the straightforward SQL injection vector.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: No official vendor advisory found

Restart Required: No

Instructions:

1. Check vendor website for updated version. 2. If no patch available, implement workarounds. 3. Consider replacing with alternative software.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement server-side validation and sanitization of the 'code' parameter to prevent SQL injection.

Modify the PHP code handling the 'code' parameter to use prepared statements with parameterized queries.

Web Application Firewall (WAF)

all

Deploy a WAF with SQL injection protection rules to block malicious requests.

Configure WAF rules to detect and block SQL injection patterns in the 'code' parameter.

🧯 If You Can't Patch

  • Isolate the RSMS application in a segmented network zone with strict firewall rules limiting access.
  • Implement database-level controls: restrict application database user permissions to minimum required operations.

🔍 How to Verify

Check if Vulnerable:

Test the /rsms/ endpoint with SQL injection payloads in the 'code' parameter (e.g., code=1' OR '1'='1). Monitor for database errors or unexpected responses.

Check Version:

Check the application's version file or configuration settings, typically found in the web root directory.

Verify Fix Applied:

After implementing fixes, retest with the same SQL injection payloads. Verify that inputs are properly sanitized and no database errors are returned.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL syntax errors in application logs
  • Multiple failed login attempts or parameter manipulation in access logs

Network Indicators:

  • HTTP requests to /rsms/ with SQL keywords in parameters (e.g., UNION, SELECT, OR)

SIEM Query:

source="web_logs" AND uri_path="/rsms/*" AND (param="code" AND value="*' OR*" OR value="*UNION*" OR value="*SELECT*")

🔗 References

📤 Share & Export