CVE-2023-28843 (published 2023-03-31T18:15Z)

PrestaShop/paypal is an open source module for the PrestaShop web commerce ecosystem which provides paypal payment support. A SQL injection vulnerability found in the PrestaShop paypal module from release from 3.12.0 to and including 3.16.3 allow a remote attacker to gain privileges, modify data, and potentially affect system availability. The cause of this issue is that SQL queries were being constructed with user input which had not been properly filtered. Only deployments on PrestaShop 1.6 are affected. Users are advised to upgrade to module version 3.16.4. There are no known workarounds for this vulnerability.

CVSS v3 base score: 9.8, CRITICAL (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-89
cwe_name: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
description: The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
extended_description: 
            
            
         
         

Fix information:
repo_url: https://github.com/202ecommerce/paypal
commit_details: repo_url: https://github.com/202ecommerce/paypal
author: Bogdan Yampolskiy
author_date: 2022-10-10 15:36:11+02:00
msg: refs #36741
repository: repo_url: https://github.com/202ecommerce/paypal
repo_name: 202ecommerce/paypal
description: This repository is for developpers only. To install and upgrade the module in a production shop please install the package via PrestaShop Marketplace by following this link:
repo_language: PHP
owner: 202ecommerce
file_changes: filename: ipn.php
change_type: ModificationType.MODIFY
diff: @@ -255,5 +255,5 @@ if (Tools::getValue('receiver_email') == Configuration::get('PAYPAL_BUSINESS_ACC
     }
 } elseif (Tools::isSubmit('custom') && (int)Configuration::get('PAYPAL_PAYMENT_METHOD') == HSS) {
     $custom = Tools::jsonDecode(Tools::getValue('custom'), true);
-    Db::getInstance()->insert('paypal_hss_email_error', array('id_cart' => $custom['id_cart'], 'email' => Tools::getValue('receiver_email')));
+    Db::getInstance()->insert('paypal_hss_email_error', array('id_cart' => (int) $custom['id_cart'], 'email' => pSQL(Tools::getValue('receiver_email', ''))));
 }

programming_language: PHP
filename: paypal.php
change_type: ModificationType.MODIFY
diff: @@ -1926,7 +1926,7 @@ class PayPal extends PaymentModule
                 }
 
                 $new_hss_email = Tools::getValue('api_business_account');
-                Db::getInstance()->delete('paypal_hss_email_error', 'email = "'.$new_hss_email.'"');
+                Db::getInstance()->delete('paypal_hss_email_error', 'email = "'. pSQL($new_hss_email) .'"');
 
                 Configuration::updateValue('PAYPAL_BUSINESS', (int) Tools::getValue('business'));
                 Configuration::updateValue('PAYPAL_PAYMENT_METHOD', (int) Tools::getValue('paypal_payment_method'));

programming_language: PHP