Language: JavaScript
Label: vulnerable
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

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,u,z,C){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=C?C:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)d=u?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,u);else{var F=document.createElement("a");C=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==
typeof F.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var K=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);C=65==(K?parseInt(K[2],10):!1)?!1:C}if(C||this.isOffline()){F.href=URL.createObjectURL(u?this.base64ToBlob(d,k):new Blob([d],{type:k}));C?F.download=f:F.setAttribute("target","_blank");document.body.appendChild(F);try{window.setTimeout(function(){URL.revokeObjectURL(F.href)},2E4),F.click(),F.parentNode.removeChild(F)}catch(O){}}else this.createEchoRequest(d,f,k,u,z).simulate(document,
"_blank")}};EditorUi.prototype.createEchoRequest=function(d,f,k,u,z,C){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,d+(null!=k?"&mime="+k:"")+(null!=z?"&format="+z:"")+(null!=C?"&base64="+C:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(u?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(d,f){f=f||"";d=atob(d);for(var k=d.length,u=Math.ceil(k/1024),z=Array(u),C=0;C<u;++C){for(var F=1024*C,K=Math.min(F+1024,k),O=Array(K-F),H=0;F<K;++H,++F)O[H]=d[F].charCodeAt(0);z[C]=