CVE-2018-8824

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary SQL commands through the Responsive Mega Menu Pro module in PrestaShop. Attackers can exploit the SQL injection in the code parameter of ajax_phpcode.php to potentially access, modify, or delete database content. All PrestaShop installations using the affected module version are vulnerable.

💻 Affected Systems

Products:
  • PrestaShop with Responsive Mega Menu (Horizontal+Vertical+Dropdown) Pro module
Versions: Module version 1.0.32 with PrestaShop 1.5.5.0 through 1.7.2.5
Operating Systems: All operating systems running PrestaShop
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects installations with the specific module version. The vulnerable file is part of the module installation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, privilege escalation, or remote code execution via database functions.

🟠

Likely Case

Data exfiltration of sensitive information like customer data, admin credentials, or payment information.

🟢

If Mitigated

Limited impact with proper input validation and database permissions restricting damage to non-critical data.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is accessible remotely without authentication.
🏢 Internal Only: MEDIUM - Internal systems could still be exploited if accessed by malicious insiders or compromised internal hosts.

🎯 Exploit Status

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

SQL injection is straightforward to exploit with common tools like sqlmap. The vulnerability requires no authentication.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Module version >1.0.32

Vendor Advisory: https://ia-informatica.com/it/CVE-2018-8824

Restart Required: No

Instructions:

1. Update the Responsive Mega Menu Pro module to the latest version. 2. Alternatively, remove the vulnerable module if not needed. 3. Apply PrestaShop security updates if available.

🔧 Temporary Workarounds

Remove vulnerable file

linux

Delete or rename the vulnerable ajax_phpcode.php file to prevent exploitation

rm modules/bamegamenu/ajax_phpcode.php
mv modules/bamegamenu/ajax_phpcode.php modules/bamegamenu/ajax_phpcode.php.bak

Web server access restriction

all

Block access to the vulnerable endpoint using web server configuration

# Apache: <Location "/modules/bamegamenu/ajax_phpcode.php"> Require all denied </Location>
# Nginx: location ~ /modules/bamegamenu/ajax_phpcode\.php { deny all; }

🧯 If You Can't Patch

  • Implement WAF rules to block SQL injection patterns targeting the vulnerable endpoint
  • Restrict database user permissions to minimize potential damage from successful exploitation

🔍 How to Verify

Check if Vulnerable:

Check if file exists: ls -la modules/bamegamenu/ajax_phpcode.php. Check module version in module configuration.

Check Version:

Check PrestaShop admin panel for module version or examine module configuration files.

Verify Fix Applied:

Verify the file no longer exists or has been updated. Test with sqlmap or manual injection attempts to confirm patching.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /modules/bamegamenu/ajax_phpcode.php with SQL keywords in parameters
  • Database error logs showing SQL syntax errors from the module

Network Indicators:

  • HTTP requests containing SQL injection payloads targeting the code parameter
  • Unusual database connections from web server IP

SIEM Query:

web.url:*ajax_phpcode.php AND (web.query:*UNION* OR web.query:*SELECT* OR web.query:*INSERT* OR web.query:*DELETE*)

🔗 References

📤 Share & Export