CVE-2026-144577: Fabric.js through 7.4.0 XSS in SVG Export via loadFromJSON Canvas Dimensions
Fabric.js through 7.4.0 contains a cross-site scripting vulnerability that allows attackers to inject markup into exported SVG by supplying crafted canvas JSON with string width and height values. Attackers can close the unescaped width, height, or viewBox attributes written by toSVG() and inject onload handlers or script elements that execute when users view the SVG.
Affected Software
Event History
Frequently Asked Questions
What application workflows are exposed?
Workflows that accept attacker-controlled canvas JSON and then call toSVG() are exposed, because crafted string width or height values can inject markup into the exported SVG. The payload executes when someone views the resulting SVG.
Does exploitation require authentication or user interaction?
The supplied vector indicates no privileges are required and network delivery is possible. Exploitation requires a user to view the malicious exported SVG.
What input should be treated as untrusted?
Treat canvas JSON passed to loadFromJSON as untrusted, particularly width and height values. These values can break out of SVG width, height, or viewBox attributes during export.