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.createUrlParameters=function(c,e,g,q,p,t,x){x=null!=x?x:[];q&&("https://viewer.diagrams.net"==EditorUi.lightboxHost&&"1"!=urlParams.dev||x.push("lightbox=1"),"auto"!=c&&x.push("target="+c),null!=e&&e!=mxConstants.NONE&&x.push("highlight="+("#"==e.charAt(0)?e.substring(1):e)),null!=p&&0<p.length&&x.push("edit="+encodeURIComponent(p)),t&&x.push("layers=1"),this.editor.graph.foldingEnabled&&x.push("nav=1"));g&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&
x.push("page-id="+this.currentPage.getId());return x};EditorUi.prototype.createLink=function(c,e,g,q,p,t,x,B,I,A){I=this.createUrlParameters(c,e,g,q,p,t,I);c=this.getCurrentFile();e=!0;null!=x?g="#U"+encodeURIComponent(x):(c=this.getCurrentFile(),B||null==c||c.constructor!=window.DriveFile?g="#R"+encodeURIComponent(g?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(g="#"+c.getHash(),e=!1));e&&null!=c&&null!=c.getTitle()&&c.getTitle()!=