CVE-2026-44311
MEDIUMFabric.js: Improper escaping in fabric.Gradient colorStops leads to XSS in SVG serialization
Title source: cnaDescription
Fabric.js is a Javascript HTML5 canvas library. Prior to 7.4.0, 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. If an application renders the generated SVG string into the DOM, this may allow an attacker to inject arbitrary HTML/SVG and execute JavaScript in the victim's browser. This vulnerability is fixed in 7.4.0.
References (2)
Core 2
Core References
X_Refsource_Confirm x_refsource_confirm
https://github.com/fabricjs/fabric.js/security/advisories/GHSA-w22m-hvvm-xmwx
X_Refsource_Misc x_refsource_misc
https://github.com/fabricjs/fabric.js/releases/tag/v740
Scores
CVSS v3
5.4
EPSS
0.0023
EPSS Percentile
13.7%
Attack Vector
NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
CISA SSVC
Vulnrichment
Exploitation
poc
Automatable
no
Technical Impact
partial
Details
CWE
CWE-116
CWE-79
Status
published
Products (2)
fabricjs/fabric.js
< 7.4.0 (2 CPE variants)
npm/fabric
0 - 7.4.0npm
Published
Jun 22, 2026
Tracked Since
Jun 23, 2026