CVE-2026-27013
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
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| fabricjs | fabric.js | to 7.2.0 (exc) |
Helpful Resources
Exploitability
| 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.