Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

rails/rails-html-sanitizer
main @ 4ddc0c7
14
Fixes
24
CVEs
CRITICAL
Peak severity
87.5%
Coverage
Highlights
Cross-Site Scripting (XSS): 9 prior fixes. Scrutinize any change in this area.
lib/rails/html/scrubbers.rb: most-fixed (9 issues). Treat as high-risk during review.
12 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Cross-Site Scripting (XSS): HTML sanitization bypasses frequently occur due to namespace confusion inside foreign elements (like SVG and MathML) or specialized tag structures (like noscript). Under specific parser states, these elements can contain nested nodes that execute scripts when deserialized.
Cross-Site Scripting (XSS): Incomplete sanitization of attributes, specifically URI-based (data: protocol) and CSS style attributes, has repeatedly allowed script execution. Developers have historically bypassed simplistic sanitizers, requiring delegation to specialized Nokogiri/Loofah parser-based APIs.