awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
cure53 avatar

cure53/DOMPurify

0
View on GitHub↗
16,638 星标·821 分支·JavaScript·other·4 次浏览cure53.de/purify↗

DOMPurify

DOMPurify is a security-focused library designed to sanitize untrusted HTML input, preventing cross-site scripting attacks by stripping malicious code while preserving safe content. It functions as a utility for secure document object model manipulation, ensuring that user-provided rich text can be rendered safely within web applications.

The library distinguishes itself through a single-pass, mutation-observer-free processing model that operates on detached document fragments to avoid triggering unintended side effects. It employs recursive node traversal and context-aware logic to inspect and neutralize dangerous elements at any depth, validating all markup against a strictly defined allowlist of permitted tags and attributes.

Beyond basic sanitization, the project provides comprehensive support for browser-level security standards, including integration with trusted types policies. This ensures that sanitized output is compatible with modern security requirements, preventing the injection of unverified strings into sensitive document sinks. The library is available as a standalone package and includes a polyfill to maintain consistent security enforcement across different browser environments.

Features

  • HTML Sanitization Utilities - Strips malicious code from untrusted HTML input to prevent cross-site scripting attacks in web applications.
  • Input Sanitization - Removes malicious code and dangerous elements from input to prevent cross-site scripting while preserving safe content.
  • Cross-Site Scripting Prevention - Provides robust sanitization and encoding techniques to prevent cross-site scripting and filter evasion attacks.
  • DOM Security Utilities - Provides a secure utility for manipulating the document object model by filtering untrusted input.
  • Trusted Types Policies - Integrates with browser-level Trusted Types to prevent the execution of unverified string-based code.
  • Trusted Types Integrations - Integrates with browser security policies to ensure sanitized output is safely handled by sensitive document sinks.
  • Safe Rich Text Renderers - Enables safe rendering of user-provided rich text by stripping dangerous elements.
  • Trusted Types Polyfills - Ensures consistent security enforcement across browsers by polyfilling Trusted Types support.
  • HTML Content Policies - Enforces strict content policies by limiting allowed HTML tags and attributes.
  • DOM Security Policy Enforcers - Ensures dynamically generated content adheres to strict document object model safety standards.
  • DOM-Tree Sanitizers - Uses native browser parsing to safely inspect and clean document fragments.
  • HTML Allowlists - Provides granular control over permitted HTML elements and attributes to prevent malicious code injection.
  • Vulnerability Scanners - XSS sanitizer for HTML, MathML, and SVG.
  • Input Validation and Sanitization - Fast and tolerant XSS sanitizer for HTML and SVG.
  • Security and Sanitization - Fast, robust XSS sanitizer for HTML and SVG.
  • Security Middleware - Fast and secure DOM-only sanitizer for HTML, MathML, and SVG.
  • Security & Privacy - Fast, high-tolerance XSS filter for HTML/SVG.
  • Sanitization Contexts - Adapts sanitization logic dynamically to handle complex or nested HTML structures safely.
  • Single-Pass Cleanup Engines - Performs efficient, side-effect-free sanitization on detached document fragments.
  • Recursive Tree Traversers - Ensures deep inspection of document structures to neutralize nested malicious content.

Star 历史

cure53/dompurify 的 Star 历史图表cure53/dompurify 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

cure53/dompurify 是做什么的?

DOMPurify is a security-focused library designed to sanitize untrusted HTML input, preventing cross-site scripting attacks by stripping malicious code while preserving safe content. It functions as a utility for secure document object model manipulation, ensuring that user-provided rich text can be rendered safely within web applications.

cure53/dompurify 的主要功能有哪些?

cure53/dompurify 的主要功能包括:HTML Sanitization Utilities, Input Sanitization, Cross-Site Scripting Prevention, DOM Security Utilities, Trusted Types Policies, Trusted Types Integrations, Safe Rich Text Renderers, Trusted Types Polyfills。

cure53/dompurify 有哪些开源替代品?

cure53/dompurify 的开源替代品包括: leizongmin/js-xss — js-xss is an HTML XSS sanitizer and whitelist-based HTML filter designed to remove malicious code from untrusted HTML.… microcosm-cc/bluemonday — bluemonday is a Go library for scrubbing user-generated HTML content to prevent cross-site scripting and other… erusev/parsedown — Parsedown is a PHP library that converts Markdown text and common extensions into structured HTML output for web… rexxars/react-markdown — react-markdown is a React renderer that converts markdown text into a virtual DOM to safely display formatted content.… apostrophecms/sanitize-html — This is an HTML sanitization library designed to remove dangerous tags and attributes from user-submitted HTML to… chriso/validator.js — validator.js is a JavaScript string validation and sanitization library. It provides a set of functions to verify that…

DOMPurify 的开源替代方案

相似的开源项目,按与 DOMPurify 的功能重合度排序。
  • leizongmin/js-xssleizongmin 的头像

    leizongmin/js-xss

    5,319在 GitHub 上查看↗

    js-xss is an HTML XSS sanitizer and whitelist-based HTML filter designed to remove malicious code from untrusted HTML. It serves as a tool for cross-site scripting prevention and user-generated content management by cleaning HTML strings to ensure safe browser rendering. The library includes a CSS style validator to scrub inline styles against a whitelist and an HTML content purifier capable of stripping all tags to extract raw text. It allows for custom HTML filtering through the definition of specific rules and handler functions to control permitted elements and attributes. The tool covers

    HTML
    在 GitHub 上查看↗5,319
  • microcosm-cc/bluemondaymicrocosm-cc 的头像

    microcosm-cc/bluemonday

    3,688在 GitHub 上查看↗

    bluemonday is a Go library for scrubbing user-generated HTML content to prevent cross-site scripting and other injection attacks. It functions as an HTML policy engine and sanitizer that removes dangerous scripts and malicious tags by applying configurable element and attribute allowlists. The project distinguishes itself through a rule-based system that utilizes regular expressions and name-based lists to define permitted tags, attributes, and CSS styles. It includes a URL security validator that enforces safe protocols and automatically injects security attributes such as nofollow and noope

    Goallowlistgogolang
    在 GitHub 上查看↗3,688
  • erusev/parsedownerusev 的头像

    erusev/parsedown

    15,049在 GitHub 上查看↗

    Parsedown is a PHP library that converts Markdown text and common extensions into structured HTML output for web browsers. It functions as a Markdown to HTML converter that processes both block-level and inline elements to generate valid web content. The library includes a PHP HTML sanitizer designed to escape HTML and scripting vectors. This security layer provides input sanitization to prevent attacks when processing untrusted user-generated content.

    PHP
    在 GitHub 上查看↗15,049
  • rexxars/react-markdownrexxars 的头像

    rexxars/react-markdown

    15,773在 GitHub 上查看↗

    react-markdown is a React renderer that converts markdown text into a virtual DOM to safely display formatted content. It functions as a markdown syntax parser and renderer that transforms markdown strings into structural elements, ensuring XSS-safe content delivery. The project allows for the mapping of standard markdown elements to custom React components for specialized styling and behavior. It supports syntax extensions through a plugin system, enabling additional formatting features such as tables, footnotes, and tasklists. The system includes security primitives for HTML and URL saniti

    JavaScript
    在 GitHub 上查看↗15,773
  • 查看 DOMPurify 的所有 30 个替代方案→