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:
y&&q.apply(this,arguments)});g=g||{};g.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:C,error:H});d=JSON.stringify({event:"remoteInvoke",funtionName:d,functionArgs:f,msgMarkers:g});null!=this.remoteWin?this.remoteWin.postMessage(d,"*"):this.remoteInvokeQueue.push(d)};EditorUi.prototype.handleRemoteInvoke=function(d,f){var g=mxUtils.bind(this,function(G,aa){var da={event:"remoteInvokeResponse",msgMarkers:d.msgMarkers};null!=aa?da.error={errResp:aa}:null!=G&&
(da.resp=G);this.remoteWin.postMessage(JSON.stringify(da),"*")});try{var l=d.funtionName,q=this.remoteInvokableFns[l];if(null!=q&&"function"===typeof this[l]){if(q.allowedDomains){for(var y=!1,F=0;F<q.allowedDomains.length;F++)if(f=="https://"+q.allowedDomains[F]){y=!0;break}if(!y){g(null,"Invalid Call: "+l+" is not allowed.");return}}var C=d.functionArgs;Array.isArray(C)||(C=[]);if(q.isAsync)C.push(function(){g(Array.prototype.slice.apply(arguments))}),C.push(function(G){g(null,G||"Unkown Error")}),
this[l].apply(this,C);else{var H=this[l].apply(this,C);g([H])}}else g(null,"Invalid Call: "+l+" is not found.")}catch(G){g(null,"Invalid Call: An error occurred, "+G.message)}};EditorUi.prototype.openDatabase=function(d,f){if(null==this.database){var g=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=g)try{var l=g.open("database",2);l.onupgradeneeded=function(q){try{var y=l.result;1>q.oldVersion&&y.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(y.createObjectStore("files",