GHSA-j8r2-2x94-2q67: Diagram js direct editing Cross-Site Scripting Vulnerability
MODERATEGHSA-j8r2-2x94-2q67 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Diagram js direct editing libraries in the npm ecosystem. The issue involves cross-site scripting in diagram-js-direct-editing. Remediation is available by upgrading affected packages to version 1.4.3.
GHSA-j8r2-2x94-2q67 at a Glance
How to Fix GHSA-j8r2-2x94-2q67
To remediate this vulnerability, upgrade all affected Diagram js direct editing 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-direct-editing@1.4.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls diagram-js-direct-editing
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-j8r2-2x94-2q67, inspect your project dependencies using npm:
npm ls diagram-js-direct-editing
Analyze the terminal output to locate any version of Diagram js direct editing in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.3), your application is affected.
Note: The npm ls diagram-js-direct-editing 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 direct editing, 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-j8r2-2x94-2q67 Affected Diagram js direct editing Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
diagram-js-direct-editing
|
npm |
< 1.4.3
|
1.4.3
|
References
Frequently Asked Questions
What is GHSA-j8r2-2x94-2q67?
Which Diagram js direct editing versions are affected?
What version fixes GHSA-j8r2-2x94-2q67?
Is diagram-js-direct-editing affected?
What CWE is associated with GHSA-j8r2-2x94-2q67?
How can I check npm dependencies for GHSA-j8r2-2x94-2q67?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j8r2-2x94-2q67",
"modified" : "2021-09-28T16:59:50Z",
"published" : "2020-09-11T21:19:09Z",
"aliases" : [ ],
"summary" : "Cross-Site Scripting in diagram-js-direct-editing",
"details" : "Versions of `diagram-js-direct-editing` prior to 1.4.3 are vulnerable to Cross-Site Scripting. The package fails to sanitize input from the clipboard, allowing attackers to execute arbitrary JavaScript in the victim's browser.\n\n\n## Recommendation\n\nUpgrade to version 1.4.3 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "diagram-js-direct-editing"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.4.3"
} ]
} ]
} ],
"references" : [ {
"type" : "PACKAGE",
"url" : "https://github.com/bpmn-io/diagram-js-direct-editing"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/983"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:43:01Z",
"nvd_published_at" : null
}
}