CVE-2024-21627 Some attribute not escaped in Validate::isCleanHTML method

High 8.1 Published Updated

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`.

Weakness: CWE-79, CWE-20

Which versions are affected by CVE-2024-21627?

4 open source packages ship an affected version, including prestashop/prestashop. It affects 1 product.

PackageAffectedFixed in
prestashop/prestashop PackagistAll versions1.7.8.11
prestashop/prestashop PackagistAll versions1.7.8.11
prestashop/prestashop PackagistFrom 8.0.0-beta.18.1.3
prestashop/prestashop PackagistFrom 8.0.0-beta.18.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.

All Prestashop Prestashop vulnerabilities

Sources

Also known as GHSA-xgpm-q3mq-46rq.

Is CVE-2024-21627 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free