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.replacePlaceholders=function(a,c,f,e){e=[];if(null!=c){for(var g=0;match=this.placeholderPattern.exec(c);){var d=match[0];if(2<d.length&&"%label%"!=d&&"%tooltip%"!=d){var k=null;if(match.index>g&&"%"==c.charAt(match.index-1))k=d.substring(1);else{var n=d.substring(1,d.length-1);if("id"==n)k=a.id;else if(0>n.indexOf("{"))for(var u=a;null==k&&null!=u;)null!=u.value&&"object"==typeof u.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(k=u.getAttribute(n+"_"+Graph.diagramLanguage)),
null==k&&(k=u.hasAttribute(n)?null!=u.getAttribute(n)?u.getAttribute(n):"":null)),u=this.model.getParent(u);null==k&&(k=this.getGlobalVariable(n));null==k&&null!=f&&(k=f[n])}e.push(c.substring(g,match.index)+(null!=k?k:d));g=match.index+d.length}}e.push(c.substring(g))}return e.join("")};Graph.prototype.restoreSelection=function(a){if(null!=a&&0<a.length){for(var c=[],f=0;f<a.length;f++){var e=this.model.getCell(a[f].id);null!=e&&c.push(e)}this.setSelectionCells(c)}else this.clearSelection()};