Language: JavaScript
Label: vulnerable
CWE: CWE-79 \u2014 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.

Code:
EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(q){q.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(q){var E=null;if(q.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{E=E||q.getSelectionCells();E=q.getExportableCells(q.model.getTopmostCells(E));for(var K={},S=q.createCellLookup(E),G=q.cloneCells(E,null,K),L=new mxGraphModel,R=L.getChildAt(L.getRoot(),
0),V=0;V<G.length;V++){L.add(R,G[V]);var d=q.view.getState(E[V]);if(null!=d){var f=q.getCellGeometry(G[V]);null!=f&&f.relative&&!L.isEdge(E[V])&&null==S[mxObjectIdentity.get(L.getParent(E[V]))]&&(f.offset=null,f.relative=!1,f.x=d.x/d.view.scale-d.view.translate.x,f.y=d.y/d.view.scale-d.view.translate.y)}}q.updateCustomLinks(q.createCellMapping(K,S),G);mxClipboard.insertCount=1;mxClipboard.setCells(G)}b.updatePasteActionStates();return E};var g=mxClipboard.paste;mxClipboard.paste=function(q){var E=
null;q.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):E=g.apply(this,arguments);b.updatePasteActionStates();return E};var n=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){n.apply(this,arguments);b.updatePasteActionStates()};var y=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(q,E){y.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};