js · fabricHeads-up
Fabric.js XSS via Gradient ColorStops in toSVG()
A Cross-Site Scripting (XSS) vulnerability was discovered in Fabric.
What changed
A Cross-Site Scripting (XSS) vulnerability was discovered in Fabric.js where the `color` field in `fabric.Gradient.colorStops` is not properly escaped during SVG serialization via `toSVG()`, allowing injection of arbitrary HTML/SVG.
Who it affects
Applications using Fabric.js that allow user-controlled input in gradient color values and render the generated SVG string into the DOM without sanitization.
What to do today
Update Fabric.js to a patched version once available, or sanitize SVG output before inserting into the DOM.
The trail
Collected→
Audited→
Written→
Published
Source
GitHub Advisory · fabric