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:
y=document.createElement("div");y.style.height="300px";y.style.width="300px";y.style.display="inline-flex";y.style.justifyContent="center";y.style.alignItems="center";y.style.position="absolute";var E=document.createElement("img");E.onload=function(){function F(){z.model.setStyle(d,g+k())}z=new Graph(D);z.autoExtend=!1;z.autoScroll=!1;z.setGridEnabled(!1);z.setEnabled(!0);z.setPanning(!1);z.setConnectable(!1);z.getRubberband().setEnabled(!1);z.graphHandler.allowLivePreview=!1;var S=z.createVertexHandler;
z.createVertexHandler=function(){var U=S.apply(this,arguments);U.livePreview=!1;return U};if(null!=f)try{if("inset"==f.substring(0,5)){var p=d.geometry,q=E.width,C=E.height,J=(300-q)/2,G=(300-C)/2,P=f.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),O=parseFloat(P[0]),N=parseFloat(P[1]),T=parseFloat(P[2]),m=parseFloat(P[3]);isFinite(O)&&isFinite(N)&&isFinite(T)&&isFinite(m)?(p.x=m/100*q+J,p.y=O/100*C+G,p.width=(100-N)/100*q+J-p.x,p.height=(100-T)/100*C+G-p.y,"round"==P[4]?"50%"==P[5]?u.setAttribute("checked",
"checked"):(I=parseInt(P[5]),A.value=I,t.setAttribute("checked","checked"),v.style.visibility="visible"):n.setAttribute("checked","checked")):f=null}else f=null}catch(U){}d.style=g+(f?f:k());d.vertex=!0;z.addCell(d,null,null,null,null);z.selectAll();z.addListener(mxEvent.CELLS_MOVED,F);z.addListener(mxEvent.CELLS_RESIZED,F);var B=z.graphHandler.mouseUp,K=z.graphHandler.mouseDown;z.graphHandler.mouseUp=function(){B.apply(this,arguments);D.style.backgroundColor="#fff9"};z.graphHandler.mouseDown=function(){K.apply(this,
arguments);D.style.backgroundColor=""};z.dblClick=function(){};var R=z.getSelectionModel().changeSelection;z.getSelectionModel().changeSelection=function(){R.call(this,[d],[d])}};E.onerror=function(){E.onload=null;E.src=Editor.errorImage};E.setAttribute("src",e);E.style.maxWidth="300px";E.style.maxHeight="300px";y.appendChild(E);x.appendChild(y);var D=document.createElement("div");D.style.width="300px";D.style.height="300px";D.style.overflow="hidden";D.style.backgroundColor="#fff9";x.appendChild(D);