DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
This PR adds the following SVG transfer function (<feFunc*>) attributes to the SVG allow list:
amplitude
exponent
intercept
slope
tablevalues
Afaik, these are all of the attributes that are available on SVG component transfer functions (offset is already on the allow list).
These attributes are used to control how colours are processed inside an <feComponentTransfer> element. All of these attributes only accept numeric values, so I don't believe they can be used to trigger scripts or other malicious behaviours. Please let me know if I'm wrong there.
Summary
This PR adds the following SVG transfer function (
<feFunc*>
) attributes to the SVG allow list:amplitude
exponent
intercept
slope
tablevalues
Afaik, these are all of the attributes that are available on SVG component transfer functions (
offset
is already on the allow list).These attributes are used to control how colours are processed inside an
<feComponentTransfer>
element. All of these attributes only accept numeric values, so I don't believe they can be used to trigger scripts or other malicious behaviours. Please let me know if I'm wrong there.Thanks again!
Background & Context
This should fix #984.
References