Fabric.js: Improper escaping in fabric.Gradient colorStops leads to XSS in SVG serialization
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- 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.4.0 | 7.4.0 | Patch available | CNA |
| — | fabric (npm) | before 7.4.0 | 7.4.0 | Patch available | GHSA-w22m-hvvm-xmwx |
- fabric.js Vendorfabricjs Affected before 7.4.0 Fixed in 7.4.0 Patch available CNA
- fabric (npm) Vendor— Affected before 7.4.0 Fixed in 7.4.0 Patch available GHSA-w22m-hvvm-xmwx
Remediation
- Fix · CNA fabric.js (fabricjs) Fixed in 7.4.0
- Fix · GHSA-w22m-hvvm-xmwx fabric (npm) Fixed in 7.4.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-44311
- 2026-10-03 Alias added: GHSA-w22m-hvvm-xmwx
References
More fabricjs Fabric.js vulnerabilities
- TI-2026-21487 Fabric.js Affected by Stored XSS via SVG Export CVSS 3.1HIGH 7.6
Sources
- CVE-2026-44311 · CVE Program
- CVE-2026-44311 · NVD
- FIRST EPSS
- GHSA-w22m-hvvm-xmwx · 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