CVE-2023-29629

9.8 CRITICAL

📋 TL;DR

CVE-2023-29629 is a critical SQL injection vulnerability in the jmsthemelayout module for PrestaShop. Attackers can execute arbitrary SQL commands through the ajax_jmsvermegamenu.php endpoint, potentially compromising the entire database. All PrestaShop installations using jmsthemelayout version 2.5.5 are affected.

💻 Affected Systems

Products:
  • PrestaShop jmsthemelayout module
Versions: Version 2.5.5
Operating Systems: All operating systems running PrestaShop
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects PrestaShop installations with the jmsthemelayout module installed and enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

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

🟠

Likely Case

Data exfiltration including customer information, admin credentials, and sensitive business data.

🟢

If Mitigated

Limited impact with proper input validation and database user privilege restrictions.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is typically accessible without authentication and exposed to the internet.
🏢 Internal Only: MEDIUM - Internal attackers could exploit this if they have network access to the PrestaShop instance.

🎯 Exploit Status

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

The vulnerability is in a publicly accessible PHP file with insufficient input sanitization, making exploitation straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Version 2.5.6 or later

Vendor Advisory: https://friends-of-presta.github.io/security-advisories/modules/2023/03/13/jmsthemelayout.html

Restart Required: No

Instructions:

1. Update the jmsthemelayout module to version 2.5.6 or later via PrestaShop admin panel or manual installation. 2. Clear PrestaShop cache. 3. Verify the module functions correctly after update.

🔧 Temporary Workarounds

Disable vulnerable endpoint

linux

Temporarily block access to the vulnerable PHP file

mv modules/jmsthemelayout/ajax_jmsvermegamenu.php modules/jmsthemelayout/ajax_jmsvermegamenu.php.disabled

Web server block

all

Add web server rule to block access to the vulnerable file

# For Apache: add to .htaccess
<Files "ajax_jmsvermegamenu.php">
    Order allow,deny
    Deny from all
</Files>
# For Nginx: add to server block
location ~* /ajax_jmsvermegamenu\.php$ {
    deny all;
    return 403;
}

🧯 If You Can't Patch

  • Implement strict WAF rules to block SQL injection patterns targeting the ajax_jmsvermegamenu.php endpoint
  • Restrict database user permissions to SELECT only for the jmsthemelayout module database user

🔍 How to Verify

Check if Vulnerable:

Check if modules/jmsthemelayout/ajax_jmsvermegamenu.php exists and examine its version in the module's configuration file.

Check Version:

grep -r 'version' modules/jmsthemelayout/config.xml 2>/dev/null || echo 'Module not found'

Verify Fix Applied:

Verify the module version is 2.5.6 or higher in PrestaShop admin panel under Modules > Module Manager.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /modules/jmsthemelayout/ajax_jmsvermegamenu.php
  • SQL error messages in web server logs
  • Multiple failed login attempts following exploitation

Network Indicators:

  • Unusual database queries from web server IP
  • Large data exfiltration from database server

SIEM Query:

source="web_server_logs" AND uri="/modules/jmsthemelayout/ajax_jmsvermegamenu.php" AND (status=500 OR method=POST)

🔗 References

📤 Share & Export