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:
Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var n=this.getModel(),y=n.getChildCount(n.root),q=0;q<y;q++)mxUtils.bind(this,function(E){function K(){n.isVisible(E)?(L.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(G,75)):(L.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(G,25))}var S=this.convertValueToString(E)||mxResources.get("background")||"Background",G=document.createElement("div");G.style.overflow=
"hidden";G.style.textOverflow="ellipsis";G.style.padding="2px";G.style.whiteSpace="nowrap";G.style.cursor="pointer";G.setAttribute("title",mxResources.get(n.isVisible(E)?"hideIt":"show",[S]));var L=document.createElement("img");L.setAttribute("draggable","false");L.setAttribute("align","absmiddle");L.setAttribute("border","0");L.style.position="relative";L.style.width="16px";L.style.padding="0px 6px 0 4px";e&&(L.style.filter="invert(100%)",L.style.top="-2px");G.appendChild(L);mxUtils.write(G,S);g.appendChild(G);
mxEvent.addListener(G,"click",function(){n.setVisible(E,!n.isVisible(E));K();null!=b&&b(E)});K()})(n.getChildAt(n.root,q));return g};