CVE-2023-1591

6.3 MEDIUM

📋 TL;DR

This critical SQL injection vulnerability in SourceCodester Automatic Question Paper Generator System 1.0 allows attackers to manipulate database queries through the id/email parameters in the Users.php file. Remote attackers can potentially access, modify, or delete sensitive data in the database. All users running the vulnerable version are affected.

💻 Affected Systems

Products:
  • SourceCodester Automatic Question Paper Generator System
Versions: 1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the web interface component; requires the vulnerable file to be accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including extraction of all user credentials, question papers, and system data; potential for authentication bypass and remote code execution.

🟠

Likely Case

Data exfiltration of user information, question papers, and system configuration; potential privilege escalation.

🟢

If Mitigated

Limited impact with proper input validation and database permissions; SQL injection attempts logged and blocked.

🌐 Internet-Facing: HIGH - Attack can be initiated remotely without authentication.
🏢 Internal Only: MEDIUM - Internal attackers could exploit, but external threat is more significant.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection vulnerabilities are typically easy to exploit with standard tools like sqlmap.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

No official patch available. Implement parameterized queries or input validation in classes/Users.php file.

🔧 Temporary Workarounds

Web Application Firewall (WAF)

all

Deploy WAF rules to block SQL injection patterns targeting the vulnerable endpoint.

Input Validation

all

Implement server-side validation for id and email parameters to reject malicious input.

🧯 If You Can't Patch

  • Isolate the system from internet access and restrict to internal network only.
  • Implement strict network segmentation and monitor all traffic to the vulnerable endpoint.

🔍 How to Verify

Check if Vulnerable:

Test the endpoint /classes/Users.php?f=save_ruser with SQL injection payloads in id or email parameters.

Check Version:

Check system documentation or configuration files for version information.

Verify Fix Applied:

Verify that SQL injection attempts no longer succeed and that parameterized queries are implemented.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in application logs
  • Multiple failed login attempts with SQL syntax in parameters
  • Access to Users.php with suspicious parameters

Network Indicators:

  • HTTP requests to /classes/Users.php containing SQL keywords like UNION, SELECT, OR 1=1

SIEM Query:

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

🔗 References

📤 Share & Export