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.arrayBufferIndexOfString=function(a,c,f){var e=c.charCodeAt(0),g=1,d=-1;for(f=f||0;f<a.byteLength;f++)if(a[f]==e){d=f;break}for(f=d+1;-1<d&&f<a.byteLength&&f<d+c.length-1;f++){if(a[f]!=c.charCodeAt(g))return Graph.arrayBufferIndexOfString(a,c,d+1);g++}return g==c.length-1?d:-1};Graph.compress=function(a,c){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=c?pako.deflate(encodeURIComponent(a)):pako.deflateRaw(encodeURIComponent(a));return btoa(Graph.arrayBufferToString(new Uint8Array(a)))};