CVE-2024-21627: Prestashop/prestashop :isCleanHTML Method Vulnerability
HIGHCVE-2024-21627 is a HIGH (CVSS 8.1) :iscleanhtml method vulnerability (CWE-20: Improper Input Validation) affecting Prestashop/prestashop libraries in the Packagist ecosystem. The issue involves :iscleanhtml method. Remediation is available by upgrading affected packages to version 8.1.3, 1.7.8.11.
CVE-2024-21627 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N).
How to Fix CVE-2024-21627
To remediate this vulnerability, upgrade all affected Prestashop/prestashop dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade prestashop/prestashop to 8.1.3
Upgrade prestashop/prestashop to 1.7.8.11
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for prestashop/prestashop
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-21627, inspect your project dependencies for Prestashop/prestashop:
inspect dependencies for prestashop/prestashop
Analyze the terminal output to locate any version of Prestashop/prestashop in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.1.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Prestashop/prestashop, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-21627 Affected Prestashop/prestashop Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
prestashop/prestashop
|
Packagist |
≥ 8.0.0-beta.1
< 8.1.3
|
8.1.3
|
|
prestashop/prestashop
|
Packagist |
< 1.7.8.11
|
1.7.8.11
|
References
Frequently Asked Questions
What is CVE-2024-21627?
Which Prestashop/prestashop versions are affected?
What version fixes CVE-2024-21627?
Is prestashop/prestashop affected?
What is the CVSS score of CVE-2024-21627?
What CWE is associated with CVE-2024-21627?
How can I check Packagist dependencies for CVE-2024-21627?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xgpm-q3mq-46rq",
"modified" : "2024-01-03T21:41:14Z",
"published" : "2024-01-03T21:41:14Z",
"aliases" : [ "CVE-2024-21627" ],
"summary" : "PrestaShop some attribute not escaped in Validate::isCleanHTML method",
"details" : "### Description\nSome event attributes are not detected by the isCleanHTML method\n\n### Impact\nSome modules using the isCleanHTML method could be vulnerable to xss\n\n### Patches\n8.1.3, 1.7.8.11\n\n### Workarounds\nThe 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`.\n\n### Reporters\n\nReported by Antonio Russo (@Antonio-R1 on GitHub) and Antonio Rocco Spataro (@antoniospataro on GitHub).\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "prestashop/prestashop"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0-beta.1"
}, {
"fixed" : "8.1.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "prestashop/prestashop"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.7.8.11"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-xgpm-q3mq-46rq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21627"
}, {
"type" : "WEB",
"url" : "https://github.com/PrestaShop/PrestaShop/commit/0ed1af8de500538490f88e9e794e2e8113fb8df7"
}, {
"type" : "WEB",
"url" : "https://github.com/PrestaShop/PrestaShop/commit/73cfb44666818eefd501b526a894fe884dd12129"
}, {
"type" : "WEB",
"url" : "https://github.com/PrestaShop/PrestaShop/commit/ba06d18466df5b92cb841d504cc7210121104883"
}, {
"type" : "WEB",
"url" : "https://github.com/PrestaShop/PrestaShop/commit/f799dcff564cd1b7ead932ffc3343b675107dbce"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/PrestaShop/PrestaShop"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-03T21:41:14Z",
"nvd_published_at" : "2024-01-02T21:15:10Z"
}
}