mutation-xss-anti-pattern

Installation
SKILL.md

Mutation XSS (mXSS) Anti-Pattern

Severity: High

Summary

Mutation XSS bypasses HTML sanitizers through inconsistent parsing. Attackers provide HTML appearing safe to sanitizers. When inserted into DOM, browser parsing "corrects" malformed code, creating executable scripts. Sanitizer sees one DOM, browser creates a different, malicious one.

The Anti-Pattern

The anti-pattern is HTML sanitizers ignoring browser's unpredictable parsing. Final browser DOM differs from sanitizer's checked DOM.

BAD Code Example

// VULNERABLE: A simple sanitizer that is unaware of browser mutations.
Installs
7
GitHub Stars
5
First Seen
Feb 19, 2026
mutation-xss-anti-pattern — igbuend/grimbard