CVE-2019-13127: Mxgraph Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-xm59-jvxm-cp3v
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2019-13127 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Mxgraph libraries in the npm ecosystem. The issue involves mxgraph vulnerable to cross-site scripting in color field. Remediation is available by upgrading affected packages to version 4.0.1.

CVE-2019-13127 at a Glance

CVE Identifier CVE-2019-13127
GHSA Identifier GHSA-xm59-jvxm-cp3v
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Mxgraph
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2019-13127

To remediate this vulnerability, upgrade all affected Mxgraph dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mxgraph fixed: 4.0.1
npm install mxgraph@4.0.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mxgraph

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2019-13127, inspect your project dependencies using npm:

npm ls mxgraph

Analyze the terminal output to locate any version of Mxgraph in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.1), your application is affected.

Note: The npm ls mxgraph command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Mxgraph, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

mxGraph through 4.0.0, related to the [draw.io Diagrams](https://github.com/jgraph/drawio) 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

CVE-2019-13127 Affected Mxgraph Versions

1 component(s)
Fixed Versions:
4.0.1
Product / Package Ecosystem Affected Versions Fixed Version
mxgraph
npm
< 4.0.1
4.0.1

References

Frequently Asked Questions

What is CVE-2019-13127?
CVE-2019-13127 is a security vulnerability in Mxgraph involving mxGraph vulnerable to cross-site scripting in color field under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Mxgraph versions are affected?
Affected versions include releases prior to 4.0.1 across affected packages: mxgraph.
What version fixes CVE-2019-13127?
Upgrading to 4.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mxgraph affected?
Yes, mxgraph is affected in releases prior to 4.0.1. Upgrade your dependency to 4.0.1 or later.
What is the CVSS score of CVE-2019-13127?
CVE-2019-13127 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2019-13127?
CVE-2019-13127 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2019-13127?
Run the dependency tree command: 'npm ls mxgraph'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xm59-jvxm-cp3v",
  "modified" : "2023-10-19T18:54:37Z",
  "published" : "2022-05-24T16:49:07Z",
  "aliases" : [ "CVE-2019-13127" ],
  "summary" : "mxGraph vulnerable to cross-site scripting in color field",
  "details" : "mxGraph through 4.0.0, related to the [draw.io Diagrams](https://github.com/jgraph/drawio) 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.\n\n**Proof of Concept (PoC):**\n\n1. Create a new draw.io Diagram, add an element and edit its background color and enter some text to the element\n2. Enter the following \"color\": `onMouseOver=alert(1) a=`\n3. Save and view the resulting diagram, moving your mouse over the text",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mxgraph"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.0.0"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-13127"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jgraph/mxgraph/commit/76e8e2809b622659a9c5ffdc4f19922b7a68cfa3"
  }, {
    "type" : "WEB",
    "url" : "https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence/version-history"
  }, {
    "type" : "WEB",
    "url" : "https://www.syss.de/fileadmin/dokumente/Publikationen/Advisories/SYSS-2019-032.txt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-19T18:54:37Z",
    "nvd_published_at" : "2019-07-01T15:15:00Z"
  }
}