Language: JavaScript
Label: vulnerable
CWE: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Code:
EditorUi.prototype.showTextDialog=function(d,f){d=new TextareaDialog(this,d,f,null,null,mxResources.get("close"));this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(d,f,k,v,z,A){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=A?A:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)d=v?this.base64ToBlob(d,k):new Blob([d],
{type:k}),navigator.msSaveOrOpenBlob(d,f);else if(mxClient.IS_IE)k=window.open("about:blank","_blank"),null==k?mxUtils.popup(d,!0):(k.document.write(d),k.document.close(),k.document.execCommand("SaveAs",!0,f),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",d):this.openInNewWindow(d,k,v);else{var H=document.createElement("a");A=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==
typeof H.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var J=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);A=65==(J?parseInt(J[2],10):!1)?!1:A}if(A||this.isOffline()){H.href=URL.createObjectURL(v?this.base64ToBlob(d,k):new Blob([d],{type:k}));A?H.download=f:H.setAttribute("target","_blank");document.body.appendChild(H);try{window.setTimeout(function(){URL.revokeObjectURL(H.href)},2E4),H.click(),H.parentNode.removeChild(H)}catch(O){}}else this.createEchoRequest(d,f,k,v,z).simulate(document,
"_blank")}};EditorUi.prototype.createEchoRequest=function(d,f,k,v,z,A){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,d+(null!=k?"&mime="+k:"")+(null!=z?"&format="+z:"")+(null!=A?"&base64="+A:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(v?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(d,f){f=f||"";d=atob(d);for(var k=d.length,v=Math.ceil(k/1024),z=Array(v),A=0;A<v;++A){for(var H=1024*A,J=Math.min(H+1024,k),O=Array(J-H),G=0;H<J;++G,++H)O[G]=d[H].charCodeAt(0);z[A]=