CVE-2026-44311
Analyzed Analyzed - Analysis Complete

Cross-Site Scripting in Fabric.js SVG Serialization

Vulnerability report for CVE-2026-44311, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-06-22

Last updated on: 2026-06-26

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-26
Generated
2026-07-13
AI Q&A
2026-06-23
EPSS Evaluated
2026-07-11
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-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.
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.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Detection Guidance

This vulnerability involves improper escaping of user-controlled input in the color field of the colorStops array within fabric.Gradient objects when serialized to SVG via the toSVG() method. Detection involves identifying if your system uses a vulnerable version of Fabric.js (prior to 7.4.0) and if it processes or renders SVG strings generated by fabric.Gradient objects.

To detect potential exploitation attempts or presence of the vulnerability, you can search for SVG strings containing suspicious or malformed color attributes that include injected HTML or JavaScript payloads.

Suggested commands include:

  • On systems storing or logging SVG content, use grep or similar tools to find suspicious patterns, for example: grep -rE 'colorStops.*".*\"><img|onerror' /path/to/logs_or_files
  • In web application codebases, check the Fabric.js version by inspecting package.json or equivalent: grep 'fabric' package.json
  • Use browser developer tools to inspect SVG elements generated by Fabric.js and look for unescaped attributes in <stop> elements within gradients.

Ultimately, upgrading Fabric.js to version 7.4.0 or later is the recommended mitigation.

Compliance Impact

The vulnerability in Fabric.js allows for Cross-Site Scripting (XSS) attacks due to improper escaping of user input during SVG serialization. Such XSS vulnerabilities can lead to unauthorized execution of JavaScript in users' browsers, potentially exposing sensitive data or enabling further attacks.

While the CVE description does not explicitly mention compliance with standards like GDPR or HIPAA, XSS vulnerabilities can impact compliance by risking the confidentiality and integrity of personal or sensitive data handled by affected applications.

Organizations using vulnerable versions of Fabric.js may face challenges in meeting security requirements mandated by these regulations, as they require protection against unauthorized data access and ensuring secure handling of user data.

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