# CVE-2026-44311: Fabric.js: Improper escaping in fabric.Gradient colorStops leads to XSS in SVG serialization

- Severity: Medium 5.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 14% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-12T21:00:32.000Z
- Modified: 2026-10-25T23:10:00.167Z
- Also known as: GHSA-w22m-hvvm-xmwx
- Weaknesses: CWE-79, CWE-116
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- fabricjs fabric.js: < 7.4.0; before 7.4.0
- fabric (npm): before 7.4.0

## Every score

- GitHub_M: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/fabricjs/fabric.js/security/advisories/GHSA-w22m-hvvm-xmwx> (exploit, mitigation, vendor-advisory, web)
- <https://github.com/fabricjs/fabric.js/releases/tag/v740> (product, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-44311> (advisory)
- <https://github.com/fabricjs/fabric.js> (package)

## Sources

- CVE List: [CVE-2026-44311](https://www.cve.org/CVERecord?id=CVE-2026-44311), CVE Terms of Use, modified 2026-06-23
- GitHub Advisory Database: [GHSA-w22m-hvvm-xmwx](https://github.com/advisories/GHSA-w22m-hvvm-xmwx), CC-BY-4.0, modified 2026-07-18
- NVD: [CVE-2026-44311](https://nvd.nist.gov/vuln/detail/CVE-2026-44311), Public domain, modified 2026-10-25

---

Page: https://cve.day/CVE-2026-44311 · Whole record: https://cve.day/CVE-2026-44311.json · Rebuilt by cve.day 2026-11-25T22:59:25.417Z
