10 Best JavaScript XSS Sanitizer 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
xss

Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist

2.6M
4.6K
Built-in
MIT
sanitize-html

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance

1.4M
3.2K
DefinitelyTyped
MIT
ins

😾 Lean and configurable whitelist-oriented HTML sanitizer

18.4K
423
No support
MIT
xc

Middleware to sanitize user input

25.3K
64
No support
MIT
es

An express.js middleware for node-validator

8.3K
45
No support
MIT
exs

Express 4.x middleware which sanitizes user input data (in req.body, req.query, req.headers and req.params) to prevent Cross Site Scripting (XSS) attack.

2.5K
9
No support
MIT
express-sanitize-escape

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

514
7
No support
MIT
es

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

425
6
DefinitelyTyped
MIT
ea

automatic sanitization of req body fields, params and query fields. uses caja. automatically does sanitization and escaping as middleware.

367
1
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
@risingstack/protect

Proactively protect your Node.js web services

180
402
No support
MIT
eas

Express middleware to auto sanitize user inputs

71
1
No support
MIT
xss

Find potential XSS vulnerabilities

59
27
No support
MIT
esh

Secure Express/Handlebars with Context Parser

17
No support
BSD
xs

Cross-Site Scripting (XSS) scanner. This tool helps to find possible XSS vulnerabilities. Cross platform - macOS, Linux, and Windows.

11
11
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.