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 N={},T=q.createCellLookup(E),F=q.cloneCells(E,null,N),K=new mxGraphModel,R=K.getChildAt(K.getRoot(),
0),W=0;W<F.length;W++){K.add(R,F[W]);var d=q.view.getState(E[W]);if(null!=d){var f=q.getCellGeometry(F[W]);null!=f&&f.relative&&!K.isEdge(E[W])&&null==T[mxObjectIdentity.get(K.getParent(E[W]))]&&(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(N,T),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}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()};