CVE-2024-21627 Some attribute not escaped in Validate::isCleanHTML method
Attackers can inject malicious scripts via unescaped HTML attributes in PrestaShop, potentially leading to session hijacking or code execution.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-21627?
CVE-2024-21627 is a high-severity cross-site scripting vulnerability in Prestashop Prestashop, published on 2 Jan 2024. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Official description
PrestaShop is an open-source e-commerce platform. Prior to versions 8.1.3 and 1.7.8.11, some event attributes are not detected by the `isCleanHTML` method. Some modules using the `isCleanHTML` method could be vulnerable to cross-site scripting. Versions 8.1.3 and 1.7.8.11 contain a patch for this issue. The best workaround is to use the `HTMLPurifier` library to sanitize html input coming from users. The library is already available as a dependency in the PrestaShop project. Beware though that in legacy object models, fields of `HTML` type will call `isCleanHTML`.
Which versions are affected by CVE-2024-21627?
4 open source packages ship an affected version, including prestashop/prestashop. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
prestashop/prestashop Packagist | All versions | 1.7.8.11 |
prestashop/prestashop Packagist | All versions | 1.7.8.11 |
prestashop/prestashop Packagist | From 8.0.0-beta.1 | 8.1.3 |
prestashop/prestashop Packagist | From 8.0.0-beta.1 | 8.1.3 |
Products include Prestashop Prestashop.
How do I fix CVE-2024-21627?
Upgrade prestashop/prestashop to a fixed version for your release line: 1.7.8.11 or 8.1.3.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2024-21627 being exploited?
There is no known exploitation of CVE-2024-21627 in the wild and no public exploit code.
Other vulnerabilities in Prestashop Prestashop
Sources
Also known as GHSA-xgpm-q3mq-46rq.