Medium

mxGraph vulnerable to cross-site scripting in color field

  • Disclosed: 24.05.2022
  • Updated: 11.10.2026 10:22

mxGraph through 4.0.0, related to the draw.io Diagrams plugin before 8.3.14 for Confluence and other products, is vulnerable to cross-site scripting. draw.io Diagrams allows the creation and editing of draw.io-based diagrams in Confluence. Among other things, it allows to set the background color of text displayed in the diagram. The color provided by the user is notproperly sanitized, leading to HTML and JavaScript code to be displayed "as it is" to visitors of the page. This allows attackers to execute JavaScript code in the context of the visitor's browser and session and to e.g. run Confluence command under the visitor's user or attack the visitor's browser.

Proof of Concept (PoC):

  1. Create a new draw.io Diagram, add an element and edit its background color and enter some text to the element
  2. Enter the following "color": onMouseOver=alert(1) a=
  3. Save and view the resulting diagram, moving your mouse over the text

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package mxgraph < 4.0.1 4.0.1

References

CVSS score 6.1/10
CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness (CWE)
CWE-79
Platform
npm
Package
mxgraph
Disclosed
24.05.2022
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-xm59-jvxm-cp3v - CC BY 4.0

Vulnerability history: mxgraph

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
05.2022 10.2022
Without a fix
1
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • Medium 2

Disclosures per year

  1. 2022: 3
  2. 2023: 0
  3. 2024: 0
  4. 2025: 0
  5. 2026: 0
  1. Medium · 6.1 CVE-2022-40440 <= 4.2.2 no fix
  2. mxGraph vulnerable to cross-site scripting in color field this entry
    Medium · 6.1 CVE-2019-13127 < 4.0.1 4.0.1
  3. Critical · 9.8 CVE-2017-18197 < 3.7.6 3.7.6

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.