Language: JavaScript
Label: vulnerable
CWE: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Code:
EditorUi.prototype.initClipboard=function(){var a=this,c=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):c.apply(this,arguments);a.updatePasteActionStates()};mxClipboard.copy=function(d){var k=null;if(d.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{k=k||d.getSelectionCells();k=d.getExportableCells(d.model.getTopmostCells(k));for(var n={},u=d.createCellLookup(k),m=d.cloneCells(k,null,n),r=new mxGraphModel,x=r.getChildAt(r.getRoot(),
0),A=0;A<m.length;A++){r.add(x,m[A]);var C=d.view.getState(k[A]);if(null!=C){var F=d.getCellGeometry(m[A]);null!=F&&F.relative&&!r.isEdge(k[A])&&null==u[mxObjectIdentity.get(r.getParent(k[A]))]&&(F.offset=null,F.relative=!1,F.x=C.x/C.view.scale-C.view.translate.x,F.y=C.y/C.view.scale-C.view.translate.y)}}d.updateCustomLinks(d.createCellMapping(n,u),m);mxClipboard.insertCount=1;mxClipboard.setCells(m)}a.updatePasteActionStates();return k};var f=mxClipboard.paste;mxClipboard.paste=function(d){var k=