# CVE-2019-13127: mxGraph cross-site scripting in color field

Source: https://junglewise.ai/threats/cve-2019-13127-mxgraph-cross-site-scripting-in-color-field  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-05-24. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2019-13127 · Severity: low · CVSS 3 · Published 2022-05-24

mxGraph is a JavaScript library used to create and edit diagrams, including integration with Confluence via the draw.io Diagrams plugin. A flaw in the color field input allows attackers to inject JavaScript code that executes in visitors' browsers, potentially enabling session hijacking, credential theft, or malicious command execution within Confluence.

Technologies: [mxgraph (npm)](https://junglewise.ai/threats/technologies/mxgraph). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2019-13127 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2019-13127 being exploited in the wild.

**How severe is CVE-2019-13127?** Low severity, with a CVSS score of 3, published 24 May 2022.

**Which products and versions are affected?** mxgraph (npm) SEMVER:introduced=0,fixed=4.0.1.

**Is there a fix for CVE-2019-13127?** Yes. mxgraph (npm): upgrade to 4.0.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2019-13127 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2019-13127?** Check whether you run mxgraph (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- mxgraph (npm): upgrade to 4.0.1 or later

  ```sh
  npm install mxgraph@4.0.1
  ```


## Technical details

mxGraph through version 4.0.0 contains a cross-site scripting (CWE-79) vulnerability in the color field input handler. The vulnerability exists because user-supplied color values are not properly sanitized before being rendered as HTML/CSS, allowing an attacker to inject arbitrary JavaScript code by crafting a malicious color string (e.g., "onMouseOver=alert(1) a="). The attack requires user interaction (hovering over the diagram element) and affects the Confluence draw.io Diagrams plugin and other products integrating mxGraph. An attacker can execute arbitrary JavaScript in the victim's browser session to perform actions as the victim. The fix was implemented in version 4.0.1 by adding input validation for color codes.

## Affected products

- JGraph mxGraph through 4.0.0

## Identifiers

- CVE-2019-13127
- GHSA-xm59-jvxm-cp3v

## Timeline

- 2019-07-01: disclosed
- 2019: patched: Version 4.0.1 released with input validation for color codes
- 2022-05-24: advisory: GHSA-xm59-jvxm-cp3v published

## References

- [https://github.com/jgraph/mxgraph/commit/76e8e2809b622659a9c5ffdc4f19922b7a68cfa3](https://github.com/jgraph/mxgraph/commit/76e8e2809b622659a9c5ffdc4f19922b7a68cfa3)

## Related threats

- [mxGraph cross-site scripting in setTooltips function](https://junglewise.ai/threats/cve-2022-40440-mxgraph-cross-site-scripting-in-settooltips-function)
- [mxGraph XXE vulnerability in XML parsing](https://junglewise.ai/threats/cve-2017-18197-mxgraph-xxe-vulnerability-in-xml-parsing)
