CVE-2026-44311: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in fabricjs fabric.js
Fabric.js versions prior to 7.4.0 contain a Cross-Site Scripting (XSS) vulnerability in the toSVG() method. The vulnerability arises from improper escaping of user-controlled input in the color field of the colorStops array within fabric.Gradient objects during SVG serialization. This can allow an attacker to inject arbitrary HTML or SVG, potentially executing JavaScript in a victim's browser if the generated SVG is rendered into the DOM. The issue is fixed in version 7.4.0.
AI Analysis
Technical Summary
Fabric.js, a JavaScript HTML5 canvas library, has an XSS vulnerability (CWE-79) in versions before 7.4.0. The toSVG() method does not properly escape the color field in the colorStops array of fabric.Gradient objects when serializing to SVG <stop> elements. This improper neutralization of input can lead to injection of malicious HTML/SVG and script execution in browsers rendering the SVG. The vulnerability is resolved in Fabric.js version 7.4.0.
Potential Impact
An attacker can exploit this vulnerability by supplying crafted input to the colorStops array, which when serialized to SVG and rendered in a victim's browser, can execute arbitrary JavaScript. This can lead to limited confidentiality and integrity impacts such as theft of user data or session tokens. The CVSS score is 5.4 (medium severity), reflecting network attack vector, low complexity, no privileges required, user interaction needed, and limited impact on confidentiality and integrity.
Mitigation Recommendations
Upgrade Fabric.js to version 7.4.0 or later, where this vulnerability is fixed. Since the vulnerability is resolved in this version, no additional mitigation is required if already using 7.4.0 or newer. Patch status is confirmed fixed in 7.4.0.
CVE-2026-44311: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in fabricjs fabric.js
Description
Fabric.js versions prior to 7.4.0 contain a Cross-Site Scripting (XSS) vulnerability in the toSVG() method. The vulnerability arises from improper escaping of user-controlled input in the color field of the colorStops array within fabric.Gradient objects during SVG serialization. This can allow an attacker to inject arbitrary HTML or SVG, potentially executing JavaScript in a victim's browser if the generated SVG is rendered into the DOM. The issue is fixed in version 7.4.0.
CVSS v3.1
Score 5.4medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Fabric.js, a JavaScript HTML5 canvas library, has an XSS vulnerability (CWE-79) in versions before 7.4.0. The toSVG() method does not properly escape the color field in the colorStops array of fabric.Gradient objects when serializing to SVG <stop> elements. This improper neutralization of input can lead to injection of malicious HTML/SVG and script execution in browsers rendering the SVG. The vulnerability is resolved in Fabric.js version 7.4.0.
Potential Impact
An attacker can exploit this vulnerability by supplying crafted input to the colorStops array, which when serialized to SVG and rendered in a victim's browser, can execute arbitrary JavaScript. This can lead to limited confidentiality and integrity impacts such as theft of user data or session tokens. The CVSS score is 5.4 (medium severity), reflecting network attack vector, low complexity, no privileges required, user interaction needed, and limited impact on confidentiality and integrity.
Mitigation Recommendations
Upgrade Fabric.js to version 7.4.0 or later, where this vulnerability is fixed. Since the vulnerability is resolved in this version, no additional mitigation is required if already using 7.4.0 or newer. Patch status is confirmed fixed in 7.4.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-05T19:00:06.021Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a39b299eed863c81e7e85c4
Added to database: 06/22/2026, 22:09:29 UTC
Last enriched: 06/22/2026, 22:24:54 UTC
Last updated: 06/23/2026, 00:58:52 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.