awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
leizongmin avatar

leizongmin/js-xss

0
View on GitHub↗
5,319 stars·633 forks·HTML·16 viewsjsxss.com↗

Js Xss

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 a broad range of sanitization capabilities, including attribute and tag prefix filtering, disallowed content removal, and tracking of stripped elements. It also provides mechanisms for character-level escape encoding and custom element handling via callback functions.

Command-line utilities are available for processing HTML files and interactive testing of filtering rules.

Features

  • Cross-Site Scripting Prevention - Filters untrusted HTML input to remove malicious scripts and prevent cross-site scripting attacks.
  • HTML Content Sanitization - Removes malicious scripts, disallowed tags, and HTML comments from untrusted content to prevent XSS attacks.
  • HTML Element Filters - Provides mechanisms to define permitted HTML tags and strip unsafe elements based on a whitelist.
  • HTML Content Filters - Provides precise control over permitted HTML elements and attributes using custom rules and handlers.
  • Character Escaping - Implements mechanisms to replace sensitive characters with HTML entities to prevent browser-based injection attacks.
  • CSS Sanitizers - Validates and scrubs inline CSS style attributes against a whitelist to prevent malicious styling injection.
  • Customizable Sanitization Rules - Enables the definition of whitelists and replacement functions to precisely control how tags and attributes are processed.
  • Whitelist-Based Style Scrubbing - Scrubs inline style attribute values by matching individual CSS properties against a whitelist of safe styles.
  • Inline Style Scrubbers - Scrubs inline CSS styles against a whitelist to prevent malicious styling in HTML content.
  • User-Generated HTML Validation - Processes and validates HTML submitted by users to maintain a secure environment while allowing limited formatting.
  • Custom Sanitization Handlers - Provides callback functions to determine how specific HTML tags and attributes are processed, replaced, or modified.
  • Custom Validation Logic - Implements custom functions to handle specific tags or attributes during the filtering process for flexible validation.
  • Full Tag Stripping - Provides a mode to strip every HTML element from a string to return only raw text.
  • Web Application Security - Implements security layers that scrub dangerous elements and inline styles from dynamic content.
  • Element Interception Callbacks - Provides custom handler functions that execute when specific tags or attributes are encountered during the sanitization process.
  • Regular Expression-Based Parsing - Uses regular expression patterns to identify and isolate HTML tags and attributes for evaluation and removal.
  • Attribute Prefix Filtering - Allows HTML attributes to persist if they start with a specified string, enabling custom data attributes while blocking dangerous ones.
  • Raw Text Extractors - Strips all HTML tags from a string to extract only raw text content.
  • Sanitization Lifecycle Hooks - Executes custom handler functions when specific tags, attributes, or ignored elements are encountered.
  • Node.js Frameworks and Tools - XSS filter based on a whitelist.
  • Security and Sanitization - Whitelist-based HTML sanitization.
  • Security Middleware - Sanitizes untrusted HTML input using configurable whitelists to prevent XSS.
  • Security & Privacy - Filters untrusted HTML to prevent XSS.

Star history

Star history chart for leizongmin/js-xssStar history chart for leizongmin/js-xss

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Js Xss

These projects share indexed features with Js Xss. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • apostrophecms/sanitize-htmlapostrophecms avatar

    apostrophecms/sanitize-html

    4,129View on GitHub↗

    This is an HTML sanitization library designed to remove dangerous tags and attributes from user-submitted HTML to prevent cross-site scripting attacks. It functions as a content filter that whitelists specific elements and attributes while escaping or discarding unauthorized markup. The project includes an HTML transformation engine that allows for the modification or replacement of tags and attributes using custom logic. It also features a CSS style validator to clean inline properties against permitted patterns and a system for resource URL validation to restrict hostnames and schemes. The

    JavaScript
    View on GitHub↗4,129
  • cure53/dompurifycure53 avatar

    cure53/DOMPurify

    16,638View on GitHub↗

    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 a

    JavaScriptcross-site-scriptingdomdompurify
    View on GitHub↗16,638
  • microcosm-cc/bluemondaymicrocosm-cc avatar

    microcosm-cc/bluemonday

    3,688View on 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
    View on GitHub↗3,688
  • crowdsecurity/crowdseccrowdsecurity avatar

    crowdsecurity/crowdsec

    12,574View on GitHub↗

    CrowdSec is a collaborative, distributed security engine designed for threat detection and infrastructure protection. It functions as an intrusion detection system that parses logs and network traffic to identify malicious patterns, utilizing a bucket-based threshold detection model to aggregate events and trigger alerts. The platform is built on a modular architecture that includes a centralized local API server for managing security signals and a relational database for persistent storage of remediation decisions. What distinguishes the project is its decoupled enforcement model, which offl

    Goattacks-preventiondetectionids
    View on GitHub↗12,574
Compare all 30 related projects→

Frequently asked questions

What does leizongmin/js-xss do?

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.

What are the main features of leizongmin/js-xss?

The main features of leizongmin/js-xss are: Cross-Site Scripting Prevention, HTML Content Sanitization, HTML Element Filters, HTML Content Filters, Character Escaping, CSS Sanitizers, Customizable Sanitization Rules, Whitelist-Based Style Scrubbing.

Which projects share features with leizongmin/js-xss?

Projects with overlapping indexed features include: apostrophecms/sanitize-html — This is an HTML sanitization library designed to remove dangerous tags and attributes from user-submitted HTML to… cure53/dompurify — DOMPurify is a security-focused library designed to sanitize untrusted HTML input, preventing cross-site scripting… microcosm-cc/bluemonday — bluemonday is a Go library for scrubbing user-generated HTML content to prevent cross-site scripting and other… crowdsecurity/crowdsec — CrowdSec is a collaborative, distributed security engine designed for threat detection and infrastructure protection.… cnodejs/nodeclub — Nodeclub is a self-hosted community forum and bulletin board system built as a Node.js web application. It serves as a… jhollingworth/bootstrap-wysihtml5 — bootstrap-wysihtml5 is a rich text editor that integrates with the Bootstrap CSS framework to provide a visual…