CVE-2018-9247

9.8 CRITICAL

📋 TL;DR

CVE-2018-9247 is a critical SQL injection vulnerability in Gxlcms QY v1.0.0713 that allows remote attackers to execute arbitrary SQL statements via the sql parameter. This can lead to arbitrary PHP code execution through file writing techniques, potentially giving attackers complete control over affected systems. All users running the vulnerable version are affected.

💻 Affected Systems

Products:
  • Gxlcms QY
Versions: v1.0.0713
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation and requires no special configuration to be exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attackers to execute arbitrary code, steal sensitive data, install backdoors, and pivot to other systems in the network.

🟠

Likely Case

Remote code execution leading to website defacement, data theft, and installation of web shells for persistent access.

🟢

If Mitigated

Limited impact if proper input validation and file system permissions prevent code execution, though SQL injection may still expose database contents.

🌐 Internet-Facing: HIGH - The vulnerability is remotely exploitable without authentication and allows full system compromise.
🏢 Internal Only: HIGH - Even internally, this vulnerability provides complete system control to any authenticated or unauthenticated attacker.

🎯 Exploit Status

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

Exploitation is straightforward with publicly available proof-of-concept code that demonstrates both SQL injection and file writing for PHP code execution.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: No official vendor advisory found

Restart Required: No

Instructions:

1. Upgrade to a patched version if available from the vendor. 2. If no patch exists, consider migrating to alternative software. 3. Manually patch the vulnerable file by implementing proper input validation and parameterized queries.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Add strict input validation to the upsql function to reject any SQL statements in the sql parameter

Edit \Lib\Lib\Action\Admin\DataAction.class.php and implement parameterized queries or strict whitelisting

File System Permissions Restriction

linux

Restrict write permissions to directories that could be targeted with INTO OUTFILE

chmod 755 /var/www/html
chown root:root /var/www/html
setfacl -R -m u:www-data:r-x /var/www/html

🧯 If You Can't Patch

  • Implement a web application firewall (WAF) with SQL injection and file write detection rules
  • Isolate the vulnerable system in a segmented network with strict outbound traffic controls

🔍 How to Verify

Check if Vulnerable:

Check if the file \Lib\Lib\Action\Admin\DataAction.class.php exists and contains the vulnerable upsql function without proper input validation

Check Version:

Check the CMS version in configuration files or admin panel, typically in config files or database

Verify Fix Applied:

Verify that the upsql function now uses parameterized queries or properly validates/sanitizes the sql parameter

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in application logs
  • File write operations to .php files in web directories
  • Requests to DataAction.class.php with sql parameter

Network Indicators:

  • POST requests containing SQL statements in parameters
  • Unusual outbound connections from web server

SIEM Query:

source="web_logs" AND (uri="*DataAction*" AND param="*sql=*SELECT*" OR param="*sql=*INTO OUTFILE*")

🔗 References

📤 Share & Export