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.getImageForPage=function(b,f,m){m=null!=m?m:this.editor.graph;var d=m.getGlobalVariable,u=this.createTemporaryGraph(m.getStylesheet());u.defaultPageBackgroundColor=m.defaultPageBackgroundColor;u.shapeBackgroundColor=m.shapeBackgroundColor;u.shapeForegroundColor=m.shapeForegroundColor;var v=this.getPageIndex(null!=f?f:this.currentPage);u.getGlobalVariable=function(F){return"pagenumber"==F?v+1:"page"==F&&null!=f?f.getName():d.apply(this,arguments)};document.body.appendChild(u.container);
this.updatePageRoot(b);u.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";m=u.getSvg(null,null,null,null,null,null,null,null,null,null,null,!0);var E=u.getGraphBounds();document.body.removeChild(u.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(m)),E.width,E.height,E.x,E.y)};