CVE-2026-27013
Received Received - Intake
Stored XSS in Fabric.js SVG Export via Unescaped Attributes

Publication date: 2026-02-19

Last updated on: 2026-02-23

Assigner: GitHub, Inc.

Description
Fabric.js is a Javascript HTML5 canvas library. Prior to version 7.2.0, Fabric.js applies `escapeXml()` to text content during SVG export (`src/shapes/Text/TextSVGExportMixin.ts:186`) but fails to apply it to other user-controlled string values that are interpolated into SVG attribute markup. When attacker-controlled JSON is loaded via `loadFromJSON()` and later exported via `toSVG()`, the unescaped values break out of XML attributes and inject arbitrary SVG elements including event handlers. Any application that accepts user-supplied JSON (via `loadFromJSON()`, collaborative sharing, import features, CMS plugins) and renders the `toSVG()` output in a browser context (SVG preview, export download rendered in-page, email template, embed) is vulnerable to stored XSS. An attacker can execute arbitrary JavaScript in the victim's browser session. Version 7.2.0 contains a fix.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-02-19
Last Modified
2026-02-23
Generated
2026-05-07
AI Q&A
2026-02-19
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
fabricjs fabric.js to 7.2.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 Powered Q&A
Can you explain this vulnerability to me?

This vulnerability exists in Fabric.js, a Javascript HTML5 canvas library, prior to version 7.2.0. The issue arises because Fabric.js applies an XML escaping function to text content during SVG export but fails to apply it to other user-controlled string values that are inserted into SVG attribute markup. When attacker-controlled JSON is loaded via the loadFromJSON() function and later exported using toSVG(), the unescaped values can break out of XML attributes and inject arbitrary SVG elements, including event handlers.

This means that any application that accepts user-supplied JSON through features like loadFromJSON(), collaborative sharing, import features, or CMS plugins, and then renders the toSVG() output in a browser context (such as SVG previews, export downloads rendered in-page, email templates, or embeds) is vulnerable to stored cross-site scripting (XSS). An attacker can exploit this to execute arbitrary JavaScript in the victim's browser session.

The vulnerability was fixed in Fabric.js version 7.2.0.


How can this vulnerability impact me? :

This vulnerability can lead to stored cross-site scripting (XSS) attacks, allowing an attacker to execute arbitrary JavaScript code in the browser session of users who view the malicious SVG output.

  • Compromise of user accounts or sessions through theft of cookies or tokens.
  • Execution of malicious scripts that can manipulate or steal sensitive data.
  • Potential defacement or unauthorized modification of displayed content.
  • Spread of malware or phishing attacks through injected scripts.

Any application that uses vulnerable versions of Fabric.js and renders user-supplied JSON as SVG in a browser context is at risk.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

I don't know


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, upgrade Fabric.js to version 7.2.0 or later, as this version contains the fix that properly escapes user-controlled string values during SVG export, preventing arbitrary SVG element injection and stored XSS.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart