CVE-2019-13127: Mxgraph Cross-Site Scripting Vulnerability
MODERATECVE-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
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).
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.
npm install mxgraph@4.0.1
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
CVE-2019-13127 Affected Mxgraph Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mxgraph
|
npm |
< 4.0.1
|
4.0.1
|
References
Frequently Asked Questions
What is CVE-2019-13127?
Which Mxgraph versions are affected?
What version fixes CVE-2019-13127?
Is mxgraph affected?
What is the CVSS score of CVE-2019-13127?
What CWE is associated with CVE-2019-13127?
How can I check npm dependencies for CVE-2019-13127?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}