IMPORTANT NOTICE: DO NOT REPORT VULNERABILITIES SOLELY TO THE AUTHOR OR MARKETPLACE.
We urge you to report any vulnerabilities directly to us. Our mission is to ensure the safety and security of the PrestaShop ecosystem. Unfortunately, many module developers may not always recognize or acknowledge the vulnerabilities in their code, whether due to lack of awareness, or inability to properly evaluate the associated risk, or other reasons.
Given the rise in professional cybercrime networks actively seeking out these vulnerabilities, it's crucial that any potential threats are promptly addressed and the community is informed. The most effective method to do this is by publishing a CVE, like the one provided below.
Should you discover any vulnerabilities, please report them to us at: report[@]security-presta.org or visit https://security-presta.org for more information.
Every vulnerability report helps make the community more secure, and we are profoundly grateful for any information shared with us.
[CVE-2023-46346] Improper Limitation of a Pathname to a Restricted Directory in MyPrestaModules - Product Catalog (CSV, Excel, XML) Export PRO module for PrestaShop
In the module “Product Catalog (CSV, Excel, XML) Export PRO” (exportproducts) up to 4.1.1 from MyPrestaModules for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.
Summary
- CVE ID: CVE-2023-46346
- Published at: 2023-10-24
- Platform: PrestaShop
- Product: exportproducts
- Impacted release: <= 4.1.1 (5.0.0 fixed the vulnerability)
- Product author: MyPrestaModules
- Weakness: CWE-22
- Severity: high (7.5)
Description
Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.
Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to this
WARNING : Be informed that this vulnerability is exploited.
CVSS base metrics
- Attack vector: network
- Attack complexity: low
- Privilege required: none
- User interaction: none
- Scope: unchanged
- Confidentiality: high
- Integrity: none
- Availability: none
Vector string: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Possible malicious usage
- Stealing secrets to unlock admin controllers based on ajax script
- Exfiltrate all modules with all versions to facilitate pentesting
- Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.
- Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)
Proof of concept
curl -v -d 'url=../../config/settings.inc.php' 'https://preprod.X/modules/exportproducts/download.php'
Patch from 4.1.1
The file has been comptely rewritten on 5.0.0.
--- a/modules/exportproducts/download.php
+++ b/modules/exportproducts/download.php
-$file = Tools::getValue('url');
+$file = basename(Tools::getValue('url'));
Other recommendations
- It’s recommended to upgrade to the latest version of the module exportproducts.
- You should consider restricting the access of modules/exportproducts/ to a whitelist
- NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd
- Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop
Timeline
Date | Action |
---|---|
2023-10-16 | Issue discovered during a code review by TouchWeb.fr |
2023-10-16 | Contact PrestaShop Addons security Team to confirm versions scope by author |
2023-10-16 | PrestaShop Addons confirms versions scopes |
2023-10-16 | Request a CVE ID |
2023-10-23 | Received CVE ID |
2023-10-24 | Publish this security advisory |
Links
DISCLAIMER: The French Association Friends Of Presta (FOP) acts as an intermediary to help hosting this advisory. While we strive to ensure the information and advice provided are accurate, FOP cannot be held liable for any consequences arising from reported vulnerabilities or any subsequent actions taken.
This advisory and patch is licensed under CC BY-SA 4.0