10 Best JavaScript XSS Libraries

List hand-picked by Openbase Experts
Learn More

dom

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:

3M
10.3K
DefinitelyTyped
(MPL-2.0 OR Apache-2.0)
express-validator

An express.js middleware for validator.js.

478K
5.7K
Built-in
MIT
ctd

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.

1.1K
3
Built-in
MIT
helmet-csp

Help secure Express apps with various HTTP headers

638K
9.3K
Built-in
MIT
x-xss-protection

Help secure Express apps with various HTTP headers

636K
9.3K
Built-in
MIT
xf

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

74.8K
DefinitelyTyped
xc

Middleware to sanitize user input

25.3K
65
No support
MIT
es

An express.js middleware for node-validator

8.3K
45
No support
MIT
showdown-xss-filter

XSS filter for the Showdown markdown converter

7.5K
30
No support
MIT
secure-filters

Anti-XSS Security Filters for EJS and More

1.3K
136
No support
BSD-3-Clause
es

An express.js middleware for sanitizing all query and body parameters automatically

425
6
DefinitelyTyped
MIT
ep

Purify your html content before marking it safe

265
17
No support
MIT
xa

Node.js Connect middleware to sanitize user input coming from POST body, GET queries, and url params. Works with Express

252
3
Built-in
MIT
np

Middleware to help to prevent xss attacks in your Express/Connect apps

230
5
No support
MIT
xss

Find potential XSS vulnerabilities

59
27
No support
MIT
xrs

Middleware to sanitize http requests

39
No support
MIT
express-csp-generator

Content Security Policy Generator, Powered by RapidSec

5
1
No support
MIT
Description
Author
License
Type Definitions
ESM Support
Tree Shakeable
Popularity
Downloads/wk
GitHub Stars
Reviews
User Rating
Voted Good Docs
Voted Easy of Use
Voted Performant
Top Positive Review
Top Negative Review
Issues
Total Issues
Open Issues
Avg Time to Close
Pull Requests
Total Pull Requests
Open Pull Requests
Avg Time to Merge
Community
Maintainers
Contributors
Contributors with 3+ commits
Top Committers
GitHub Forks
Versions
# of Versions
Latest
Next
Beta
Newest
Oldest
Major Every
Minor Every
Patch Every
Dependencies
Dependencies
Dev Dependencies
Links
More Info
README
Tutorials
Install Command
There's Nothing Here
No packages are selected.
Select a few packages to compare.