The module Redirections Manager (smplredirectionsmanager) from Smart Plugs contains a Blind SQL injection vulnerability up to version 1.1.19. This module is for the PrestaShop e-commerce platform.

Summary

  • CVE ID: CVE-2023-26864
  • Published at: 2023-01-17
  • Advisory source: Friends-Of-Presta
  • Platform: PrestaShop
  • Product: smplredirectionsmanager
  • Impacted release: < 1.1.19 (1.1.19 fixed the vulnerability)
  • Product author: Smart Plugs
  • Weakness: CWE-89
  • Severity: critical (9.8)

Description

The method SmplTools::getMatchingRedirectionsFromParts() hold a sensitive SQL calls that can be executed with a trivial http call and exploited to forge a blind SQL injection.

The large scope of URL exposed to the vulnerability increases its severity and the risk that a pattern of URL is in whitelist of a WAF.

WARNING : This vulnerability will bypass some WAF, for this reason, POC is not given.

CVSS base metrics

  • Attack vector: network
  • Attack complexity: low
  • Privilege required: none
  • User interaction: none
  • Scope: unchanged
  • Confidentiality: high
  • Integrity: high
  • Availability: high

Vector string: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Possible malicious usage

This vulnerability permits altering the shop’s database.

Patch of release 1.1.19

--- a/smplredirectionsmanager/classes/SmplTools.php
+++ b/smplredirectionsmanager/classes/SmplTools.php
@@ -104,10 +104,10 @@ class SmplTools
                     }
                 }
                 $contrainte_request_uri .= ($contrainte_request_uri ? ' OR' : '').' old_request_path="'.
-                    pSQL(preg_replace('#\?.*#', '', $smpl_relative_uri)).'?'.$str_querystring.'"';
+                    pSQL(preg_replace('#\?.*#', '', $smpl_relative_uri)).'?'.pSQL($str_querystring).'"';
                 foreach ($smpl_absolute_uris as $smpl_absolute_uri) {
                     $contrainte_request_uri .= ' OR old_request_path="'.
-                        pSQL(preg_replace('#\?.*#', '', $smpl_absolute_uri)).'?'.$str_querystring.'"';
+                        pSQL(preg_replace('#\?.*#', '', $smpl_absolute_uri)).'?'.pSQL($str_querystring).'"';
                 }
             }
         } else {

Timeline

Date Action
2022-10-10 Issue discovered by TouchWeb’s auto-pentesting bots
2022-10-11 Contact the author
2022-11-14 Fix published on addons PrestaShop marketplace
2023-01-12 Request CVE ID
2023-01-17 Publish this security advisory

Other recommendations

  • It’s recommended to upgrade to the latest version of the module smplredirectionsmanager.
  • Upgrade PrestaShop to the latest version to disable multiquery executions (separated by “;”) - be warned that this functionality WILL NOT protect your SHOP against injection SQL which uses the UNION clause to steal data.
  • Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS
  • Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.