CVE-2017-16017: Cross-Site Scripting in sanitize-html

sanitize-html Updated 02 Oct 2025

Summary

09/11/2018
Yes i
Moderate
6.1

CVE-2017-16017: Cross-Site Scripting in sanitize-html. Affects sanitize-html versions < 1.2.3. Fixed in 1.2.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The sanitize-html package is an npm package that provides a way to sanitize and clean HTML input, removing potentially harmful elements and attributes. It is commonly used in web applications to prevent cross-site scripting (XSS) attacks by sanitizing user-generated content before displaying it on web pages.

Vulnerability Detail

The affected versions of sanitize-html are vulnerable to cross-site scripting (XSS) attacks. This vulnerability allows an attacker to inject malicious scripts into web pages viewed by users, potentially leading to the theft of sensitive information, session hijacking, or other malicious activities. The vulnerability arises from incorrect interpretation of HTML tags by the parser, allowing an attacker to bypass the sanitization process and execute arbitrary JavaScript code.

How To Fix

Minimum fixed version

1.2.3

This is the first release that contains the fix.

npm install sanitize-html@1.2.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to update to the fixed version of the sanitize-html package to mitigate the risk of XSS attacks.

Conclusion

In conclusion, the sanitize-html package is vulnerable to cross-site scripting (XSS) attacks in versions prior to 1.2.3. It is crucial to update to the fixed version to mitigate the risk of XSS attacks and ensure the security of your web application. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for sanitize-html →

Share this vulnerability

FAQ

Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by users. These scripts can be used to steal sensitive information, manipulate web content, or perform other malicious actions.

The sanitize-html package provides a way to sanitize and clean HTML input by removing potentially harmful elements and attributes. It helps prevent XSS attacks by ensuring that user-generated content is properly sanitized before being displayed on web pages.

The consequences of this vulnerability include the theft of sensitive information, session hijacking, defacement of web pages, and other malicious activities. It can have a significant impact on the security and integrity of web applications.

No, only versions prior to 1.2.3 are affected by this vulnerability. It is recommended to update to version 1.2.3 or later to ensure the security of your application.

To update the sanitize-html package, you can use the package manager for your project (e.g., npm) and run the command to update the package to the latest version. For example, you can run npm update sanitize-html to update to the latest version.

Related vulnerabilities

Recent vulnerabilities recorded for sanitize-html.

How To Fix

Minimum fixed version

1.2.3

This is the first release that contains the fix.

npm install sanitize-html@1.2.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback