Packages

Input Sanitization & Security Packages

Input sanitization, XSS prevention, and application-security utilities that clean untrusted input before it reaches your rendering or storage layer (DOMPurify).

119 packages

Packages in Input Sanitization & Security

91Health
Library npm

DOMPurify

DOM-only, uber-tolerant XSS sanitizer for HTML, MathML, and SVG that runs in the browser and on the server.

17,508
Apache 2.0
Used by 134
49Health
Library npm

cors

Node.js CORS middleware for Express and Connect that sets standards-compliant headers to control cross-origin browser access.

6,193
MIT
Used by 78
85Health
Library npm

sanitize-html

Allowlist-based HTML sanitizer that strips XSS vectors from untrusted markup while preserving the tags and attributes you choose to keep.

4,659
MIT
Used by 41
37Health
Library npm

rehype-sanitize

A unified rehype plugin that sanitizes HTML to prevent XSS by dropping anything a schema does not explicitly allow.

224
MIT
Used by 33
61Health
Library npm

helmet

Secure Node and Express apps by setting protective HTTP response headers with a single line of middleware.

10,746
MIT
Used by 32
85Health
Library npm

express-rate-limit

Basic IP rate-limiting middleware for Express to throttle repeated requests and protect public APIs and sensitive endpoints.

3,316
MIT
Used by 29
59Health
Library npm

validator.js

A dependency-free library of 100+ string validators and sanitizers for Node.js and the browser.

23,743
MIT
Used by 26
50Health
Library npm

isbot

Detect bots, crawlers, and spiders from the user agent string with a single call.

1,168
Other
Used by 22
73Health
Library PyPI

markupsafe

Escapes untrusted strings for safe use in HTML and XML markup, preventing injection attacks in templated output.

701
BSD 3
Used by 20
55Health
Library Go

cors

A spec-compliant, configurable CORS middleware for Go's net/http, with drop-in compatibility for most Go web frameworks.

2,901
MIT
Used by 18
83Health
Library npm

rate-limiter-flexible

Atomic and non-atomic counters and rate-limiting tools that protect against DoS and brute-force attacks at any scale

3,599
Other
Used by 16
41Health
Library PyPI

defusedxml

Drop-in replacements for Python's XML modules that block XML-bomb and entity-expansion attacks

559
Other
Used by 15
45Health
Library Go

bluemonday

A fast, allowlist-based HTML sanitizer for Go that strips XSS vectors from untrusted content while preserving safe markup.

3,730
BSD 3
Used by 14
41Health
Library npm

html-entities

Fast, zero-dependency HTML5/HTML4/XML entity encoding and decoding for JavaScript and TypeScript.

686
MIT
Used by 14
73Health
Library npm

@fastify/cors

Official Fastify plugin that adds configurable CORS headers and preflight handling to any Fastify API.

496
MIT
Used by 14
74Health
Library npm

isolated-vm

Secure, isolated V8 JavaScript environments for Node.js

2,947
Other
Used by 13
58Health
Library npm

shell-quote

Parses and quotes POSIX shell command strings, guarding against shell injection when building commands programmatically.

67
MIT
Used by 12
55Health
Library npm

he

A robust, spec-compliant HTML entity encoder and decoder for JavaScript with full Unicode support.

3,612
MIT
Used by 11
85Health
SDK npm

react-turnstile

React bindings for Cloudflare Turnstile — a privacy-first CAPTCHA alternative with a declarative component and a full imperative ref API.

863
MIT
Used by 11
82Health
Library npm

isomorphic-dompurify

Isomorphic wrapper for DOMPurify that sanitizes HTML identically on server and client.

607
MIT
Used by 11
68Health
Library PyPI

django-cors-headers

Configurable CORS headers middleware for Django applications

5,585
MIT
Used by 10
75Health
Library npm

express-validator

A chainable Express middleware that wraps validator.js to validate and sanitize incoming request data with minimal boilerplate.

6,231
MIT
Used by 8
60Health
Library Go

govalidator

A comprehensive Go package of string, numeric, and struct validators and sanitizers, modeled on validator.js.

6,202
MIT
Used by 7
68Health
Library Cargo

secrecy

Rust wrapper types that keep secrets out of logs, debug output, and Clone/Copy, and securely wipe them from memory on drop

579
Other
Used by 7

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers