Description
A potential Cross-Site Scripting (XSS) vulnerability exists in Fabric.js due to improper escaping of user-controlled input during SVG serialization via the toSVG() method.
Specifically, the color field within the colorStops array of a fabric.Gradient object is not properly escaped when converted into SVG <stop> elements.
Recommendation
Update the fabric package to the latest compatible version. Followings are version details:
- Affected version(s): < 7.4.0
- Patched version(s): 7.4.0
References
Could your website be exposed too?
SmartScanner can check your website for Fabric.js improper escaping in fabric.Gradient colorStops leads to XSS in SVG serialization and gives you actionable findings to investigate.
Start a free scanRelated Issues
- Fabric.js Affected by Stored XSS via SVG Export - CVE-2026-27013
- @nuxtjs/mdc's URL sanitizer misses SVG xlink:href and data:text/html, allowing XSS from untrusted markdown at the defaul - CVE-2026-63671
- beautiful-mermaid contains an SVG attribute injection issue that can lead to cross-site scripting (XSS) - CVE-2026-26226
- Open WebUI has Stored XSS in Banner Component via Improper Sanitization Order - CVE-2026-45665


