CVE-2021-40814

9.8 CRITICAL

📋 TL;DR

This SQL injection vulnerability in the Customer Photo Gallery addon for PrestaShop allows attackers to execute arbitrary SQL commands through the vulnerable module. It affects PrestaShop websites using the Customer Photo Gallery addon before version 2.9.4. Attackers could potentially access, modify, or delete database content.

💻 Affected Systems

Products:
  • PrestaShop Customer Photo Gallery addon
Versions: All versions before 2.9.4
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects PrestaShop installations with the Customer Photo Gallery addon installed and enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including theft of customer data, administrative credentials, and full control of the PrestaShop installation.

🟠

Likely Case

Data exfiltration of customer information, potential privilege escalation, and database manipulation.

🟢

If Mitigated

Limited impact due to proper input validation and database permissions, potentially only read-only access to non-sensitive data.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SQL injection vulnerabilities are commonly exploited and tools exist for automated exploitation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.9.4

Vendor Advisory: https://www.getastra.com/blog/911/plugin-exploit/prestashops-customer-photo-gallery-module-vulnerable-to-sql-injection-attacks/

Restart Required: No

Instructions:

1. Log into PrestaShop admin panel
2. Navigate to Modules > Module Manager
3. Find Customer Photo Gallery addon
4. Update to version 2.9.4 or later
5. Clear PrestaShop cache

🔧 Temporary Workarounds

Disable vulnerable module

all

Temporarily disable the Customer Photo Gallery addon until patched

Navigate to PrestaShop admin > Modules > Module Manager > Customer Photo Gallery > Disable

Web Application Firewall rules

all

Implement WAF rules to block SQL injection patterns targeting the module

Add SQL injection detection rules to your WAF configuration

🧯 If You Can't Patch

  • Implement strict input validation and parameterized queries at application level
  • Restrict database user permissions to minimum required for module functionality

🔍 How to Verify

Check if Vulnerable:

Check module version in PrestaShop admin panel under Modules > Module Manager > Customer Photo Gallery

Check Version:

SELECT version FROM ps_module WHERE name = 'customerphotogallery'

Verify Fix Applied:

Confirm module version is 2.9.4 or higher in PrestaShop admin

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts from single IP
  • Unexpected database schema changes

Network Indicators:

  • SQL injection patterns in HTTP requests to PrestaShop endpoints
  • Unusual outbound database connections

SIEM Query:

source="web_server" AND ("customerphotogallery" OR "gallery") AND ("UNION" OR "SELECT" OR "INSERT" OR "DELETE" OR "UPDATE")

🔗 References

📤 Share & Export