Cross-site Scripting (XSS) Affecting sanitize-html package, versions <2.0.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.03% (9th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-SANITIZEHTML-585892
  • published7 Sept 2020
  • disclosed7 Sept 2020
  • creditmikesamuel

Introduced: 7 Sep 2020

CVE-2019-25225  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade sanitize-html to version 2.0.0 or higher.

Overview

sanitize-html is a library that allows you to clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the sanitizeHtml function when the custom transformTags option is used. An attacker can inject and execute malicious code by providing crafted input that is not properly sanitized.

CVSS Base Scores

version 4.0
version 3.1