CVE-2018-12052

9.8 CRITICAL

📋 TL;DR

This CVE describes a SQL injection vulnerability in PHP Scripts Mall Schools Alert Management Script. Attackers can inject malicious SQL queries via the 'q' parameter in get_sec.php, potentially allowing unauthorized database access. Organizations using this specific software are affected.

💻 Affected Systems

Products:
  • PHP Scripts Mall Schools Alert Management Script
Versions: All versions prior to patch (specific version unknown)
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Requires PHP environment with database backend (typically MySQL). The vulnerability is in the application code itself, not dependent on specific OS or PHP version.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data manipulation, authentication bypass, and potential remote code execution via database functions.

🟠

Likely Case

Unauthorized data access, extraction of sensitive information (student records, credentials), and potential privilege escalation.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database permissions restricting access to sensitive tables.

🌐 Internet-Facing: HIGH - The vulnerability is in a web application component and public exploits exist, making internet-facing instances prime targets.
🏢 Internal Only: MEDIUM - Internal instances are still vulnerable but have reduced attack surface compared to internet-facing deployments.

🎯 Exploit Status

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

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

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown specific version - check with vendor

Vendor Advisory: No official vendor advisory found in references

Restart Required: No

Instructions:

1. Contact PHP Scripts Mall for updated version. 2. Replace vulnerable get_sec.php file with patched version. 3. Implement parameterized queries or proper input validation. 4. Test functionality after update.

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation to sanitize the 'q' parameter before processing

Edit get_sec.php and add: $q = mysqli_real_escape_string($connection, $_GET['q']);

WAF Rule

all

Implement web application firewall rules to block SQL injection patterns

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

🧯 If You Can't Patch

  • Implement network segmentation to isolate the vulnerable system from sensitive databases
  • Deploy a web application firewall with SQL injection detection rules

🔍 How to Verify

Check if Vulnerable:

Test by accessing get_sec.php with SQL injection payload: /get_sec.php?q=1' OR '1'='1

Check Version:

Check PHP Scripts Mall documentation or contact vendor for version information

Verify Fix Applied:

Test with same payload after patch - should return error or no data instead of executing query

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple requests to get_sec.php with suspicious parameters
  • Database queries with unusual patterns from web server IP

Network Indicators:

  • HTTP requests containing SQL keywords (UNION, SELECT, INSERT) in URL parameters
  • Abnormal database traffic patterns from web servers

SIEM Query:

source="web_logs" AND uri="*get_sec.php*" AND (param="*q=*'*" OR param="*q=*%27*")

🔗 References

📤 Share & Export