GHSA-8fw4-xh83-3j6q: Diagram js Cross-Site Scripting Vulnerability
MODERATEGHSA-8fw4-xh83-3j6q is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Diagram js libraries in the npm ecosystem. The issue involves cross-site scripting in diagram-js. Remediation is available by upgrading affected packages to version 2.6.2, 3.3.1.
GHSA-8fw4-xh83-3j6q at a Glance
How to Fix GHSA-8fw4-xh83-3j6q
To remediate this vulnerability, upgrade all affected Diagram js 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 diagram-js@2.6.2
npm install diagram-js@3.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls diagram-js
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-8fw4-xh83-3j6q, inspect your project dependencies using npm:
npm ls diagram-js
Analyze the terminal output to locate any version of Diagram js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.2), your application is affected.
Note: The npm ls diagram-js 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 Diagram js, 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
GHSA-8fw4-xh83-3j6q Affected Diagram js Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
diagram-js
|
npm |
< 2.6.2
|
2.6.2
|
|
diagram-js
|
npm |
≥ 3.0.0
< 3.3.1
|
3.3.1
|
References
Frequently Asked Questions
What is GHSA-8fw4-xh83-3j6q?
Which Diagram js versions are affected?
What version fixes GHSA-8fw4-xh83-3j6q?
Is diagram-js affected?
What CWE is associated with GHSA-8fw4-xh83-3j6q?
How can I check npm dependencies for GHSA-8fw4-xh83-3j6q?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8fw4-xh83-3j6q",
"modified" : "2021-09-28T16:58:42Z",
"published" : "2020-09-11T21:18:05Z",
"aliases" : [ ],
"summary" : "Cross-Site Scripting in diagram-js",
"details" : "Versions of `diagram-js` prior to 3.3.1 (for 3.x) and 2.6.2 (for 2.x) are vulnerable to Cross-Site Scripting. The package fails to escape output of user-controlled input in `search-pad`, allowing attackers to execute arbitrary JavaScript.\n\n\n## Recommendation\n\nIf you are using diagram-js 3.x, upgrade to version 3.3.1.\nIf you are using diagram-js 2.x, upgrade to version 2.6.2.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "diagram-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "diagram-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/bpmn-io/diagram-js/commit/2565c40449379284a55163f290ec812db34244d1"
}, {
"type" : "WEB",
"url" : "https://github.com/bpmn-io/diagram-js/commit/777fa06d70036daa9d02f3be6d0732cf4ccd8d6d"
}, {
"type" : "WEB",
"url" : "https://bpmn.io/blog/posts/2019-html-injection-vulnerabilities-fixed.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/bpmn-io/diagram-js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:42:58Z",
"nvd_published_at" : null
}
}