Security context

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

owasp/java-html-sanitizer
main @ a979a97
6
Fixes
2
CVEs
CRITICAL
Peak severity
Highlights
Cross-Site Scripting (XSS): 3 prior fixes. Scrutinize any change in this area.
ElementAndAttributePolicyBasedSanitizerPolicy: most-fixed (1 issue). Treat as high-risk during review.
5 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: HTML tags containing leading whitespace inside their brackets (such as < script>) can bypass initial tag-name validation checks, allowing execution of unsanitized scripts. Developers must ensure tag names are strictly trimmed of whitespace before validating them against policies.
Cross-Site Scripting (XSS): Disallowed HTML tags embedded inside CDATA/RCDATA context elements, such as style or script tags, must be stripped to prevent malicious text chunks from being parsed as raw executable HTML block bypasses.
Cross-Site Scripting: Permissive policies allowing style tags inside select/option boundaries can be exploited to escape CDATA bounds and inject executable scripts. Escaping routines must use comment-wrapped CDATA segments and strict substring validation to prevent nested context breakouts.