Fabric.js improper escaping in fabric.Gradient colorStops leads to XSS in SVG serialization
CVE-2026-44311GHSA-w22m-hvvm-xmwx
What to do
Vendor fix available. Upgrade each affected package to the fixed version on its release line (fabric 7.4.0), redeploy, then verify what is actually installed.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
npm fabric
- Affected
- < 7.4.0
- Fixed in
- 7.4.0
Sources
- Open Source Vulnerabilities (OSV.dev), including the GitHub Advisory Database
OSV record GHSA-w22m-hvvm-xmwx lists affected ranges: npm fabric >=0 <7.4.0 (fixed)
VerifiedObserved Structured OSV record; GitHub-reviewed advisory.
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-w22m-hvvm-xmwx lists affected ranges: npm fabric >=0 <7.4.0
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS
- 5.4 · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- EPSS
- CVE-2026-44311: 0.27% estimated exploitation activity in the next 30 days; percentile 19.57 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description
As published by the source; long descriptions are shortened.
Summary 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 (e.g., via innerHTML), this may allow an attacker to inject arbitrary HTML/SVG and execute JavaScript in the victim's browser. Details During SVG export, Fabric.js serializes gradient color stops into <stop elements like: However, the color value is inserted into the stop-color attribute without proper escaping of special characters such as ", <, and . This allows crafted input to break out of the attribute context and inject arbitrary markup. For example: may result in: This breaks the intended SVG structure and introduces executable HTML. PoC (Proof of Concept) Successfully verified on v7.2.0…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 2 · amended ·
Amended from ghsa record GHSA-w22m-hvvm-xmwx
- Revision 1 · created ·
Published from osv record GHSA-w22m-hvvm-xmwx
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: CVE-2026-44311 Advisory: Fabric.js improper escaping in fabric.Gradient colorStops leads to XSS in SVG serialization IDs: CVE-2026-44311, GHSA-w22m-hvvm-xmwx Record: https://patchnext.com/advisories/cve-2026-44311 (revision 2, source checked 26 Oct 2026, 12:57 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Medium (CVSS 5.4) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Vendor fix available; fixed versions by package: fabric 7.4.0. A vendor fix does not mean a deployment is fixed. ## Affected components - npm fabric: affected < 7.4.0; fixed in 7.4.0 ## Suggested inspection (read-only) - `npm ls fabric --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`. ## Supported action Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on fabric. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://osv.dev/vulnerability/GHSA-w22m-hvvm-xmwx (OSV record GHSA-w22m-hvvm-xmwx lists affected ranges: npm fabric >=0 <7.4.0 (fixed)) - Verified: https://github.com/advisories/GHSA-w22m-hvvm-xmwx (GitHub-reviewed advisory GHSA-w22m-hvvm-xmwx lists affected ranges: npm fabric >=0 <7.4.0) Commands are suggestions: review each one before running it.
Loading voting…