CVE-2026-44311
Received Received - Intake
Cross-Site Scripting in Fabric.js SVG Serialization

Publication date: 2026-06-22

Last updated on: 2026-06-22

Assigner: GitHub, Inc.

Description
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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-22
Last Modified
2026-06-22
Generated
2026-06-23
AI Q&A
2026-06-23
EPSS Evaluated
N/A
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
fabricjs fabric.js to 7.4.0 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-116 The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

This vulnerability exists in Fabric.js, a Javascript HTML5 canvas library, prior to version 7.4.0. It is a Cross-Site Scripting (XSS) issue caused by 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. This flaw allows an attacker to inject arbitrary HTML or SVG code, which can then execute JavaScript in the victim's browser if the generated SVG string is rendered into the DOM.

Impact Analysis

This vulnerability can allow an attacker to execute arbitrary JavaScript code in the context of the victim's browser. This can lead to various malicious actions such as stealing sensitive information, hijacking user sessions, performing actions on behalf of the user, or delivering further malware. The impact is limited to confidentiality and integrity as indicated by the CVSS score, with no direct impact on availability.

Mitigation Strategies

To mitigate this vulnerability, update Fabric.js to version 7.4.0 or later, where the issue with improper escaping in the toSVG() method has been fixed.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-44311. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart