hast-util-sanitize

JSON →
library 5.0.2 ·javascript
verified May 27, 2026

hast-util-sanitize is a JavaScript utility designed to make HAST (Hypertext Abstract Syntax Tree) nodes safe by removing potentially dangerous user-generated content, primarily to prevent Cross-Site Scripting (XSS) vulnerabilities. Currently at version 5.0.2, the package is actively maintained as part of the unified ecosystem, with a steady release cadence addressing features and breaking changes. It provides a robust, extensible schema, defaulting to GitHub's sanitation rules, allowing developers to customize allowed elements, attributes, and attribute values. This makes it a crucial tool for applications handling untrusted HTML input, either directly or through higher-level wrappers like rehype-sanitize. Its focus on direct HAST manipulation allows for fine-grained control over the sanitization process.

total hits 19
actors 9 distinct systems
last hit 20h ago human
MetaBot
4
GPTBot
2
ChatGPT-User
2
Script
1
ClaudeBot
1
Search engines
2
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇳🇴 Norway · 🇫🇷 France · NZ