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:
if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var H=d.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(U){U=null!=U?U:"";"1"==urlParams.dev&&(U+=(0<U.length?"&":"?")+"dev=1");return H.apply(this,arguments)};var J=f.addClickHandler;f.addClickHandler=function(U,Q,Y){var m=Q;Q=function(C,M){if(null==M){var ba=mxEvent.getSource(C);"a"==ba.nodeName.toLowerCase()&&(M=ba.getAttribute("href"))}null!=
M&&f.isCustomLink(M)&&(mxEvent.isTouchEvent(C)||!mxEvent.isPopupTrigger(C))&&f.customLinkClicked(M)&&mxEvent.consume(C);null!=m&&m(C,M)};J.call(this,U,Q,Y)};q.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var O=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(U,Q,Y){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(U,["zoomIn","zoomOut","-"],null,Y);O.apply(this,arguments);