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:
Graph.prototype.createLayersDialog=function(b,e){var k=document.createElement("div");k.style.position="absolute";for(var n=this.getModel(),D=n.getChildCount(n.root),t=0;t<D;t++)mxUtils.bind(this,function(E){function d(){n.isVisible(E)?(l.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(g,75)):(l.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(g,25))}var f=this.convertValueToString(E)||mxResources.get("background")||"Background",g=document.createElement("div");g.style.overflow=
"hidden";g.style.textOverflow="ellipsis";g.style.padding="2px";g.style.whiteSpace="nowrap";g.style.cursor="pointer";g.setAttribute("title",mxResources.get(n.isVisible(E)?"hideIt":"show",[f]));var l=document.createElement("img");l.setAttribute("draggable","false");l.setAttribute("align","absmiddle");l.setAttribute("border","0");l.style.position="relative";l.style.width="16px";l.style.padding="0px 6px 0 4px";e&&(l.style.filter="invert(100%)",l.style.top="-2px");g.appendChild(l);mxUtils.write(g,f);k.appendChild(g);
mxEvent.addListener(g,"click",function(){n.setVisible(E,!n.isVisible(E));d();null!=b&&b(E)});d()})(n.getChildAt(n.root,t));return k};