9 Best Node.js XSS Libraries

List hand-picked by Openbase Experts
Learn More

dom

dompurify

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:

(MPL-2.0 OR Apache-2.0)
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
GitHub Stars
9.9K
Weekly Downloads
2.8M
Last Commit
7mos ago
User Rating
5.0/ 5
2
Top Feedback
3Easy to Use
2Performant
ctd

csp-typed-directives

Provides type information for all CSP directives and related headers' directives; as well as a basic utility funtion that helps convert the typed properties to key/values of each header content's policy string.

MIT
TypeScript Icon
TypeScript Definitions: Built-In
GitHub Stars
3
Weekly Downloads
518
Last Commit
1yr ago
User Rating
5.0/ 5
1
Top Feedback
1Easy to Use
1Performant
1Highly Customizable
x-xss-protection

x-xss-protection

Help secure Express apps with various HTTP headers

MIT
TypeScript Icon
TypeScript Definitions: Built-In
GitHub Stars
9.3K
Weekly Downloads
605K
Last Commit
8mos ago
xf

xss-filters

Secure XSS Filters - Just sufficient output filtering to prevent XSS!

Unknown
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
GitHub Stars
Weekly Downloads
86.7K
Last Commit
xc

xss-clean

Middleware to sanitize user input

MIT
TypeScript Icon
TypeScript Definitions: Not Found
GitHub Stars
55
Weekly Downloads
22K
Last Commit
7yrs ago
showdown-xss-filter

showdown-xss-filter

XSS filter for the Showdown markdown converter

MIT
TypeScript Icon
TypeScript Definitions: Not Found
GitHub Stars
30
Weekly Downloads
7.8K
Last Commit
7yrs ago
secure-filters

secure-filters

Anti-XSS Security Filters for EJS and More

BSD-3-Clause
TypeScript Icon
TypeScript Definitions: Not Found
GitHub Stars
136
Weekly Downloads
1.2K
Last Commit
10mos ago
ep

ember-purify

Purify your html content before marking it safe

MIT
TypeScript Icon
TypeScript Definitions: Not Found
GitHub Stars
17
Weekly Downloads
281
Last Commit
2yrs ago
xss

xsslint

Find potential XSS vulnerabilities

MIT
TypeScript Icon
TypeScript Definitions: Not Found
GitHub Stars
27
Weekly Downloads
69
Last Commit
3yrs ago