cure53/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: observed · 2026-08-28
Health v2 · maintenance only
99/100
- Activity 99
- Release rhythm 98
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 9
- age_days: 4580
- days_rel: 14
- days_push: 9
- n_releases_24m: 30
Adoption not part of the score
17339 stars · 858 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
DOMPurify is a fast, DOM-only XSS sanitizer for HTML, MathML and SVG that removes malicious markup while allowing safe content. It works in all modern browsers and Node.js via jsdom, with secure defaults plus extensive configuration and hooks.
Use cases
- sanitize user-submitted html to prevent xss
- clean rich text before rendering in the browser
- allow safe svg and mathml content from untrusted sources
- sanitize html server-side in node.js
- strip dangerous attributes and tags from markup
- prevent cross-site scripting attacks in a web app
When to choose
- you render untrusted HTML, SVG, or MathML and need battle-tested XSS protection
- you want secure defaults with fine-grained allowlist and hook configuration
- you need a small, fast, dependency-free sanitizer across browsers and Node.js
When to avoid
- you need to sanitize non-HTML formats like Markdown, CSS, or JSON
- you must support legacy MSIE and need the maintained 2.x branch instead
- you want a full CSP or Trusted Types policy rather than markup sanitization
Facets
library · maturity stable
security web-framework frontend-framework security web-development frontend browser xss sanitizer html-sanitization dom svg mathml input-sanitization nodejs javascript
2 sources
- readme: https://github.com/cure53/DOMPurify · fetched 2026-08-28 · 6638e1097431
- homepage: https://cure53.de/purify · fetched 2026-08-29 · 4c6a2ee88532
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| cure53/DOMPurify | main | 99 |
For agents
markdown · JSON · MCP: product_card(name="cure53/DOMPurify")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem