Example Usage
using Ganss.Xss;
var sanitizer = new HtmlSanitizer();
var html = @"<script>alert('xss')</script><div onload=""alert('xss')"""
+ @"style=""background-color: rgba(0, 0, 0, 1)"">Test<img src=""test.png"""
+ @"style=""background-image: url(javascript:alert('xss')); margin: 10px""></div>";
var sanitized = sanitizer.Sanitize(html, "https://www.example.com");
var expected = @"<div style=""background-color: rgba(0, 0, 0, 1)"">"
+ @"Test<img src=""https://www.example.com/test.png"" style=""margin: 10px""></div>";
Assert.Equal(expected, sanitized);
See also
public-skills-builder
Free
Generate Claude Code bug bounty skills from public HackerOne reports and GitHub writeups — 18 vuln c…
Burp Suite
Freemium
Kali
Leading platform for web application security testing. The Community Edition includes an interceptin…
API-Pentesting-Tools
Open Source
API Pentesting Tools are specialized security tools used to test and analyze the security of Applica…
Advanced-WAF-WAFinity
Free
An Advanced Web Application Firewall that protects against threats like SQL injection and XSS by fil…
xurlfind3r
Open Source
A command-line utility designed to discover URLs for a given domain in a simple, efficient way. It w…
UltimateCMSWordlists
Open Source
📚 An ultimate collection wordlists of the best-known CMS…