CVE-2017-15987

9.8 CRITICAL

📋 TL;DR

CVE-2017-15987 is a critical SQL injection vulnerability in Fake Magazine Cover Script that allows attackers to execute arbitrary SQL commands through the rate.php value parameter or content.php id parameter. This affects all websites running vulnerable versions of this script, potentially exposing database contents and system access.

💻 Affected Systems

Products:
  • Fake Magazine Cover Script
Versions: All versions prior to patching
Operating Systems: Any OS running PHP with MySQL
Default Config Vulnerable: ⚠️ Yes
Notes: Affects any installation using the vulnerable rate.php or content.php scripts with SQL queries.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, privilege escalation, and potential remote code execution on the underlying server.

🟠

Likely Case

Database content extraction including user credentials, sensitive information, and potential website defacement.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries preventing SQL injection.

🌐 Internet-Facing: HIGH - Web applications are directly accessible and vulnerable parameters are exposed.
🏢 Internal Only: MEDIUM - Internal systems could be targeted through internal network access or compromised accounts.

🎯 Exploit Status

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

Exploit code is publicly available and requires minimal technical skill to execute.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not specified

Vendor Advisory: Not available

Restart Required: No

Instructions:

1. Replace vulnerable scripts with secure versions using parameterized queries. 2. Implement input validation and sanitization. 3. Consider replacing with maintained software.

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation to rate.php and content.php parameters

// In PHP, add: if(!is_numeric($_GET['id'])) { die('Invalid input'); }
// For value parameter: if(!is_numeric($_GET['value'])) { die('Invalid input'); }

Web Application Firewall Rules

linux

Block SQL injection patterns in rate.php and content.php

# ModSecurity rule: SecRule ARGS "(?i:(union|select|insert|update|delete|drop|alter).*)" "id:1001,phase:2,deny,msg:'SQL Injection Attempt'"
# For Apache: RewriteCond %{QUERY_STRING} (union|select|insert|update|delete|drop|alter) [NC]

🧯 If You Can't Patch

  • Implement a Web Application Firewall (WAF) with SQL injection rules
  • Restrict access to vulnerable scripts using IP whitelisting or authentication

🔍 How to Verify

Check if Vulnerable:

Test rate.php?value=1' OR '1'='1 and content.php?id=1' OR '1'='1 for SQL error responses

Check Version:

Check script files for modification dates and compare with known vulnerable versions

Verify Fix Applied:

Test with same payloads and verify no SQL errors or unexpected behavior occurs

📡 Detection & Monitoring

Log Indicators:

  • SQL syntax errors in web server logs
  • Unusual parameter values in rate.php or content.php requests
  • Multiple failed SQL query attempts

Network Indicators:

  • HTTP requests containing SQL keywords to vulnerable endpoints
  • Unusual database query patterns from web server

SIEM Query:

source="web.log" AND (uri_path="/rate.php" OR uri_path="/content.php") AND (query_string="*union*" OR query_string="*select*" OR query_string="*insert*")

🔗 References

📤 Share & Export