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:
document?(d=document.createEvent("HTMLEvents"),d.initEvent("change",!1,!0),c.dispatchEvent(d)):c.fireEvent("onchange")});a=function(d){d=c.value.toLowerCase();for(var k=0,n=0;n<f.length;n++){var u=f[n].extension,m=null;"drawio"!=u&&(m=u,u=".drawio."+u);if(d.substring(d.length-u.length-1)=="."+u||null!=m&&d.substring(d.length-m.length-1)=="."+m){k=n;break}}e.value=k};mxEvent.addListener(c,"change",a);mxEvent.addListener(c,"keyup",a);a();return e};