CVE-2017-17622

9.8 CRITICAL

📋 TL;DR

This vulnerability allows attackers to execute arbitrary SQL commands via the 'sort' parameter in exams.php in Online Exam Test Application Script 1.6. This affects any organization using this specific version of the web application. Attackers can potentially access, modify, or delete database content.

💻 Affected Systems

Products:
  • Online Exam Test Application Script
Versions: Version 1.6
Operating Systems: Any OS running PHP and MySQL
Default Config Vulnerable: ⚠️ Yes
Notes: Requires PHP and MySQL database backend. Vulnerability exists in default installation.

📦 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 if database permissions allow.

🟠

Likely Case

Unauthorized data access, data exfiltration, and potential privilege escalation within the application.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database permission restrictions in place.

🌐 Internet-Facing: HIGH - Web applications are typically internet-facing, making them directly accessible to attackers.
🏢 Internal Only: MEDIUM - Internal users could still exploit this, but attack surface is reduced compared to internet-facing deployments.

🎯 Exploit Status

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

Multiple public exploit scripts available. No authentication required to exploit.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown - No official patch identified

Vendor Advisory: No vendor advisory found

Restart Required: No

Instructions:

1. Review application source code
2. Implement parameterized queries for all database operations
3. Add input validation for the sort parameter
4. Test thoroughly before deployment

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side validation to only allow specific, safe values for the sort parameter

// PHP example: if(!in_array($_GET['sort'], ['safe_value1', 'safe_value2'])) { die('Invalid parameter'); }

Web Application Firewall Rule

linux

Block SQL injection patterns in the sort parameter

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

🧯 If You Can't Patch

  • Implement a Web Application Firewall (WAF) with SQL injection detection rules
  • Restrict network access to only trusted IP addresses

🔍 How to Verify

Check if Vulnerable:

Test the exams.php endpoint with SQL injection payloads in the sort parameter (e.g., sort=1' OR '1'='1)

Check Version:

Check application files for version information or review source code comments

Verify Fix Applied:

Attempt SQL injection tests and verify they are blocked or sanitized

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple failed login attempts following SQL injection patterns
  • Unexpected database queries

Network Indicators:

  • HTTP requests with SQL keywords in sort parameter
  • Unusual database traffic patterns

SIEM Query:

source="web_logs" AND (uri="*exams.php*" AND query="*sort=*'*" OR query="*sort=*%27*")

🔗 References

📤 Share & Export