CVE-2019-13127 is a medium-severity (CVSS 6.1) Improper Input Validation vulnerability in mxgraph. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for mxgraph — see the affected versions and patch details below.
mxGraph vulnerable to cross-site scripting in color field
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, a proxy for how much of the ecosystem is exposed.
mxgraphnpmDescription
mxGraph through 4.0.0, related to the draw.io Diagrams 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):
- Create a new draw.io Diagram, add an element and edit its background color and enter some text to the element
- Enter the following "color":
onMouseOver=alert(1) a= - Save and view the resulting diagram, moving your mouse over the text
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | mxgraph | all versions | 4.0.1npm install mxgraph@4.0.1 |
Affected Products
draw.io diagramsdrawmxgraphjgraphResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mxgraph, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update mxgraph to 4.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2019-13127 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2019-13127 in your dependencies?
Find it across npm, including transitive dependencies.