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:
u.onreadystatechange=function(){f(u)};u.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(d));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(z){}};EditorUi.prototype.isResampleImageSize=function(d,f){f=null!=f?f:this.resampleThreshold;return d>f};EditorUi.prototype.resizeImage=function(d,f,k,u,z,C,F){z=null!=z?z:this.maxImageSize;var K=Math.max(1,d.width),O=Math.max(1,d.height);if(u&&this.isResampleImageSize(null!=F?F:f.length,C))try{var H=
Math.max(K/z,O/z);if(1<H){var ka=Math.round(K/H),fa=Math.round(O/H),ca=document.createElement("canvas");ca.width=ka;ca.height=fa;ca.getContext("2d").drawImage(d,0,0,ka,fa);var ja=ca.toDataURL();if(ja.length<f.length){var ma=document.createElement("canvas");ma.width=ka;ma.height=fa;var aa=ma.toDataURL();ja!==aa&&(f=ja,K=ka,O=fa)}}}catch(S){}k(f,K,O)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,f,k){try{var u=