{"id":27910,"date":"2025-04-20T14:24:39","date_gmt":"2025-04-20T14:24:39","guid":{"rendered":""},"modified":"2025-05-06T12:01:26","modified_gmt":"2025-05-06T12:01:26","slug":"cve-2024-21627-cross-site-scripting-vulnerability-in-prestashop-s-iscleanhtml-method","status":"publish","type":"post","link":"https:\/\/www.ameeba.com\/blog\/cve-2024-21627-cross-site-scripting-vulnerability-in-prestashop-s-iscleanhtml-method\/","title":{"rendered":"<strong>CVE-2024-21627: Cross-Site Scripting Vulnerability in PrestaShop\u2019s `isCleanHTML` Method<\/strong>"},"content":{"rendered":"<p><strong>Overview<\/strong><\/p>\n<p>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 <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-32569-critical-deserialization-of-untrusted-data-vulnerability-in-tableon-wordpress-plugin\/\"  data-wpil-monitor-id=\"32320\">vulnerability lies in its potential to lead to data<\/a> leakage or even a full system compromise if successfully exploited by an attacker. Users and administrators of the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-32603-sql-injection-vulnerability-in-hk-wp-online-users-stats\/\"  data-wpil-monitor-id=\"32346\">PrestaShop<\/a> platform should be aware of this vulnerability and take necessary steps to mitigate its risks.<\/p>\n<p><strong>Vulnerability Summary<\/strong><\/p>\n<p>CVE ID: CVE-2024-21627<br \/>\nSeverity: High (CVSS: 8.1)<br \/>\nAttack Vector: Network<br \/>\nPrivileges Required: None<br \/>\nUser Interaction: Required<br \/>\nImpact: Data Leakage and <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-23391-incorrect-privilege-assignment-in-suse-rancher-potentially-leading-to-system-compromise\/\"  data-wpil-monitor-id=\"33134\">Potential System<\/a> Compromise<\/p>\n<p><strong>Affected Products<\/strong><\/p><div id=\"ameeb-2685077832\" class=\"ameeb-content-2 ameeb-entity-placement\"><div style=\"border-left: 4px solid #555; padding-left: 20px; margin: 48px 0; font-family: Roboto, sans-serif; color: #ffffff; line-height: 1.6; max-width: 700px;\">\r\n  <h2 style=\"margin-top: 0; font-size: 20px; font-weight: 600; display: flex; align-items: center;\">\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\" style=\"display: inline-flex; align-items: center; margin-right: 8px;\">\r\n      <img decoding=\"async\" src=\"https:\/\/www.ameeba.com\/blog\/wp-content\/uploads\/2025\/10\/Best-App-icon-Ameeba.png\" alt=\"Ameeba Chat Icon\" style=\"width: 40px; height: 40px;\" \/>\r\n    <\/a>\r\n    A new way to communicate\r\n  <\/h2>\r\n\r\n  <p style=\"margin-bottom: 12px;\">\r\n    Ameeba Chat is built on encrypted identity, not personal profiles.\r\n  <\/p>\r\n\r\n  <p style=\"margin-bottom: 16px;\">\r\n    Message, call, share files, and coordinate with identities kept separate.\r\n  <\/p>\r\n\r\n  <ul style=\"list-style: none; padding-left: 0; margin-bottom: 20px;\">\r\n    <li>\u2022 Encrypted identity<\/li>\r\n    <li>\u2022 Ameeba Chat authenticates access<\/li>\r\n    <li>\u2022 Aliases and categories<\/li>\r\n    <li>\u2022 End-to-end encrypted chat, calls, and files<\/li>\r\n    <li>\u2022 Secure notes for sensitive information<\/li>\r\n  <\/ul>\r\n\r\n  <p style=\"font-style: italic; font-weight: 600; margin-bottom: 24px;\">\r\n    Private communication, rethought.\r\n  <\/p>\r\n\r\n  <div style=\"display: flex; flex-wrap: wrap; gap: 12px;\">\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\/download\" style=\"background-color: #ffffff; color: #000000; padding: 10px 20px; text-decoration: none; border-radius: 6px; font-weight: 500;\">Download Ameeba Chat<\/a>\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\" style=\"border: 1px solid #ffffff; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 6px; font-weight: 500;\">Learn More<\/a>\r\n  <\/div>\r\n<\/div>\r\n<\/div>\n<p>Product | Affected Versions<\/p>\n<p>PrestaShop | < 8.1.3\nPrestaShop | < 1.7.8.11\n\n<strong>How the Exploit Works<\/strong><\/p>\n<p>The vulnerability arises from PrestaShop&#8217;s `isCleanHTML` method not detecting certain event attributes, which can <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2024-56406-buffer-overflow-vulnerability-in-perl-leading-to-potential-denial-of-service-and-code-execution\/\"  data-wpil-monitor-id=\"33133\">potentially lead<\/a> to a Cross-Site Scripting (XSS) attack. An attacker could exploit this by <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-22655-sql-injection-vulnerability-in-caio-web-dev-cwd-stealth-links\/\"  data-wpil-monitor-id=\"37700\">injecting malicious scripts into the web<\/a> application, which would then be executed when a user interacts with the affected web page. This could result in a successful attacker gaining unauthorized <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2023-50343-hcl-dryice-myxalytics-improper-access-control-vulnerability\/\"  data-wpil-monitor-id=\"32440\">access to sensitive information or even taking control<\/a> of the system.<\/p>\n<p><strong>Conceptual Example Code<\/strong><\/p>\n<p>Here&#8217;s a conceptual example of how the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2023-50123-exploitable-vulnerability-in-hozard-alarm-system-sms-authentication\/\"  data-wpil-monitor-id=\"37701\">vulnerability might be exploited<\/a>:<\/p><div id=\"ameeb-2357904404\" class=\"ameeb-content ameeb-entity-placement\"><div class=\"poptin-embedded\" data-id=\"f6b387694f681\"><\/div>\r\n\r\n\r\n\r\n\r\n\r\n<\/div>\n<pre><code class=\"\" data-line=\"\">POST \/prestashop\/addProduct HTTP\/1.1\nHost: target.example.com\nContent-Type: text\/html\n{ &quot;productName&quot;: &quot;&lt;script&gt;malicious_script_here&lt;\/script&gt;&quot; }<\/code><\/pre>\n<p>In this example, the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-35996-cross-site-scripting-attack-in-kunbus-pictory\/\"  data-wpil-monitor-id=\"42843\">attacker injects a script<\/a> within the `productName` attribute. When this product name is displayed on the web page, the browser executes the malicious script, <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2023-48263-unauthenticated-remote-attack-leading-to-dos-and-potential-rce\/\"  data-wpil-monitor-id=\"34375\">leading to the XSS attack<\/a>.<\/p>\n<p><strong>Mitigation Guidance<\/strong><\/p>\n<p>The most effective <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-43971-critical-vulnerability-in-gobgp-paving-the-way-for-system-compromise\/\"  data-wpil-monitor-id=\"40137\">way to mitigate this vulnerability<\/a> 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.<br \/>\nIf 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`.<br \/>\nAs always, it is recommended to follow good security practices, such as input validation and sanitization, to further <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-31491-critical-vulnerability-in-autogpt-leads-to-leakage-of-cross-domain-cookies-and-protected-headers\/\"  data-wpil-monitor-id=\"34257\">protect against such vulnerabilities<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[1],"tags":[],"vendor":[],"product":[],"attack_vector":[81],"asset_type":[],"severity":[],"exploit_status":[],"class_list":["post-27910","post","type-post","status-publish","format-standard","hentry","category-uncategorized","attack_vector-xss"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/27910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/comments?post=27910"}],"version-history":[{"count":9,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/27910\/revisions"}],"predecessor-version":[{"id":38146,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/27910\/revisions\/38146"}],"wp:attachment":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/media?parent=27910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/categories?post=27910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/tags?post=27910"},{"taxonomy":"vendor","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/vendor?post=27910"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/product?post=27910"},{"taxonomy":"attack_vector","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/attack_vector?post=27910"},{"taxonomy":"asset_type","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/asset_type?post=27910"},{"taxonomy":"severity","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/severity?post=27910"},{"taxonomy":"exploit_status","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/exploit_status?post=27910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}