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:
Math.max(M/A,O/A);if(1<H){var ja=Math.round(M/H),da=Math.round(O/H),ca=document.createElement("canvas");ca.width=ja;ca.height=da;ca.getContext("2d").drawImage(d,0,0,ja,da);var ia=ca.toDataURL();if(ia.length<f.length){var ma=document.createElement("canvas");ma.width=ja;ma.height=da;var aa=ma.toDataURL();ia!==aa&&(f=ia,M=ja,O=da)}}}catch(la){}l(f,M,O)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,f,l){try{var u=
new Image;u.onload=function(){u.width=0<u.width?u.width:120;u.height=0<u.height?u.height:120;f(u)};null!=l&&(u.onerror=l);u.src=d}catch(A){if(null!=l)l(A);else throw A;}};EditorUi.prototype.getDefaultSketchMode=function(){var d="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:d)};var y=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?