Fabric.js Affected by Stored XSS via SVG Export
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · Low · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| fabricjs | fabric.js | before 7.2.0 | 7.2.0 | Patch available | CNA |
| — | fabric (npm) | before 7.2.0 | 7.2.0 | Patch available | GHSA-hfvx-25r5-qc3w |
- fabric.js Vendorfabricjs Affected before 7.2.0 Fixed in 7.2.0 Patch available CNA
- fabric (npm) Vendor— Affected before 7.2.0 Fixed in 7.2.0 Patch available GHSA-hfvx-25r5-qc3w
Remediation
- Fix · CNA fabric.js (fabricjs) Fixed in 7.2.0
- Fix · GHSA-hfvx-25r5-qc3w fabric (npm) Fixed in 7.2.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-27013
- 2026-10-03 Alias added: GHSA-hfvx-25r5-qc3w
References
More fabricjs Fabric.js vulnerabilities
- TI-2026-32279 Fabric.js: Improper escaping in fabric.Gradient colorStops leads to XSS in SVG serialization CVSS 3.1MEDIUM 6.1
Sources
- CVE-2026-27013 · CVE Program
- CVE-2026-27013 · NVD
- FIRST EPSS
- GHSA-hfvx-25r5-qc3w · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences