1-Click Cross-Site Scripting via Custom Configuration in SafeListSanitizer
The SafeListSanitizer, when explicitly configured to allow form and button tags plus the formaction attribute, can be given crafted input that results in cross-site scripting. The maintainers argue this is not a vulnerability because the default configuration sanitises the input and the required configuration is extremely unlikely.
- Disclosed after 44 days
Summary by the program
Researcher @leonsirio reported that the SafeListSanitizer, when explicitly configured to allow form and button tags and the formaction attribute, can be fed crafted input that results in XSS. It's the position of the maintainers that although this may be undesirable behavior, that it does not constitute a security vulnerability because the developer must opt-in to allow multiple blocked tags (form and button) and a blocked attribute (formaction). The default sanitizer configuration successfully sanitizes the input, and we feel this POC requires an extremely unlikely configuration -- in a real world application, it would be extremely surprising to configure the sanitizer to allow these tags and attributes in untrusted content.
We would prefer to address in the public tracker the sanitizer's behavior when configured to allow formaction attributes.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the sanitiser's allow-list logic does not account for the combination of form and button elements with the formaction attribute, letting crafted markup survive sanitisation.
Impact
An attacker could run script in a victim's browser, but only where a developer had opted in to allowing form, button and formaction in untrusted content; the default configuration blocked it.
What the attacker needed
Sanitiser configured to allow form and button; sanitiser configured to allow formaction; untrusted content reaches the sanitiser
The fix
The maintainers prefer to address the sanitiser's behaviour when formaction is allowed in the public tracker rather than treat it as a security fix.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A sanitiser is a tool that cleans user-supplied HTML so dangerous parts are removed. Here, a developer had deliberately told the sanitiser to keep form and button elements and a particular attribute, and in that unusual setup a crafted input could still run script in a victim's browser. The default setup was not affected.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.