Overview
The open-source e-commerce platform, PrestaShop, suffers from a significant cross-site scripting (XSS) vulnerability, identified as CVE-2024-21627. This vulnerability is particularly concerning as it affects all PrestaShop versions prior to 8.1.3 and 1.7.8.11. The severity of this vulnerability lies in its potential to lead to data leakage or even a full system compromise if successfully exploited by an attacker. Users and administrators of the PrestaShop platform should be aware of this vulnerability and take necessary steps to mitigate its risks.
Vulnerability Summary
CVE ID: CVE-2024-21627
Severity: High (CVSS: 8.1)
Attack Vector: Network
Privileges Required: None
User Interaction: Required
Impact: Data Leakage and Potential System Compromise
Affected Products
No phone number, email, or personal info required.
Product | Affected Versions
PrestaShop | < 8.1.3 PrestaShop | < 1.7.8.11 How the Exploit Works
The vulnerability arises from PrestaShop’s `isCleanHTML` method not detecting certain event attributes, which can potentially lead to a Cross-Site Scripting (XSS) attack. An attacker could exploit this by injecting malicious scripts into the web application, which would then be executed when a user interacts with the affected web page. This could result in a successful attacker gaining unauthorized access to sensitive information or even taking control of the system.
Conceptual Example Code
Here’s a conceptual example of how the vulnerability might be exploited:
POST /prestashop/addProduct HTTP/1.1
Host: target.example.com
Content-Type: text/html
{ "productName": "<script>malicious_script_here</script>" }
In this example, the attacker injects a script within the `productName` attribute. When this product name is displayed on the web page, the browser executes the malicious script, leading to the XSS attack.
Mitigation Guidance
The most effective way to mitigate this vulnerability is by applying the vendor patch. Those using PrestaShop versions 8.1.3 and 1.7.8.11 are already protected as these versions contain a patch for this issue.
If updating is not immediately possible, users can use a Web Application Firewall (WAF) or Intrusion Detection System (IDS) as a temporary mitigation. Additionally, the `HTMLPurifier` library, which is a dependency in the PrestaShop project, can be used to sanitize HTML input coming from users. However, be aware that in legacy object models, fields of `HTML` type will call `isCleanHTML`.
As always, it is recommended to follow good security practices, such as input validation and sanitization, to further protect against such vulnerabilities.