CVE-2024-8343

7.3 HIGH

📋 TL;DR

This critical SQL injection vulnerability in SourceCodester Sentiment Based Movie Rating System 1.0 allows remote attackers to execute arbitrary SQL commands via the email parameter during user registration. Attackers can potentially access, modify, or delete database contents. All deployments of version 1.0 are affected.

💻 Affected Systems

Products:
  • SourceCodester Sentiment Based Movie Rating System
Versions: 1.0
Operating Systems: All platforms running PHP/MySQL web servers
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the /classes/Users.php?f=save_client endpoint used for user registration. Any deployment with this version is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data destruction, privilege escalation to admin, and potential remote code execution if database functions allow it.

🟠

Likely Case

Unauthorized data access, user account compromise, and potential data manipulation affecting movie ratings and user information.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only error messages or limited data exposure.

🌐 Internet-Facing: HIGH - The vulnerability is remotely exploitable and affects a web application component accessible from the internet.
🏢 Internal Only: MEDIUM - Internal attackers could exploit this, but external threat is higher due to public exploit availability.

🎯 Exploit Status

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

Public exploit code is available on GitHub. The vulnerability requires no authentication and has simple exploitation vectors.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: https://www.sourcecodester.com/

Restart Required: No

Instructions:

No official patch available. Check vendor website for updates. Consider implementing workarounds or replacing the software.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement server-side input validation for email parameter to reject SQL injection patterns

Modify /classes/Users.php to add: $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
Add prepared statements: $stmt = $conn->prepare('INSERT INTO users (email) VALUES (?)'); $stmt->bind_param('s', $email);

WAF Rule

all

Deploy web application firewall rules to block SQL injection patterns in email parameter

ModSecurity rule: SecRule ARGS:email "@detectSQLi" "id:1001,phase:2,deny,status:403"

🧯 If You Can't Patch

  • Isolate the application behind a reverse proxy with strict input validation
  • Implement network segmentation to limit database access from the application server

🔍 How to Verify

Check if Vulnerable:

Test the /classes/Users.php?f=save_client endpoint with SQL injection payloads in email parameter (e.g., ' OR '1'='1)

Check Version:

Check PHP files for version comments or review installation documentation

Verify Fix Applied:

Test with same payloads after fixes - should return validation errors instead of executing SQL

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple failed registration attempts with SQL patterns in email field
  • Database query errors containing injection patterns

Network Indicators:

  • HTTP POST requests to /classes/Users.php with SQL keywords in parameters
  • Unusual database connection patterns from application server

SIEM Query:

source="web_logs" AND uri="/classes/Users.php" AND (email="*OR*" OR email="*UNION*" OR email="*SELECT*")

🔗 References

📤 Share & Export