The vulnerability centers around improper HTML sanitization in the XSS filter. The key functions identified are:
-
validator.xss.clean: The primary entry point for XSS filtering, modified extensively in the patch to add missing protections. The pre-patch version lacked proper handling of:
- Nested forbidden patterns in attributes
- HTML entity decoding before validation
- Base64 data URI filtering
- Array prototype manipulation protection
-
filter_attributes: Directly processes HTML attributes and was vulnerable to regex bypasses. The patch completely rewrote its logic to prevent comment-based bypasses and improve pattern matching.
The test case changes demonstrate exploitation scenarios involving nested tags (like <comment>), javascript: URI bypasses, and attribute-based payloads - all of which would flow through these functions. The patch modifications directly target these vulnerable code paths by adding proper filtering layers.