Language: JavaScript
Label: vulnerable
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresponse:",V,"\nresult:",S),this.spinner.stop(),e(S,N,O,Q))}),A)}),A,mxUtils.bind(this,function(N){3>n++?t.clear()&&(this.spinner.stop(),p()):A(N)}))}),A);else{var C={message:mxResources.get("error")+" "+G.getStatus()};try{C=JSON.parse(G.getText()),C=C.error}catch(V){}A(C)}}),A)}),k)});p()};EditorUi.prototype.extractMermaidMindmap=function(c){for(0<c[1].indexOf("orientation")&&c.splice(1,1);1<c.length&&""==c[1];)c.splice(1,1);
for(var e=[],k=2;k<c.length;k++){var n=mxUtils.trim(c[k]);"["!=n&&"]"!=n&&"%%"!=n.substring(0,2)&&"##"!=n.substring(0,2)&&(n=c[k].replace(/[-|>]/g," "),""!=mxUtils.trim(n)&&" "==n.charAt(0)&&e.push(n))}return"mindmap\nroot(("+mxUtils.trim(c[1])+"))\n"+e.join("\n")};EditorUi.prototype.extractMermaidDeclaration=function(c){"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var e=c.split("```");e=1<e.length?e:c.split("<pre>");e=1<e.length?e:c.split("~~~");e=1<e.length?e:c.split("%%");e=1<e.length?e:c.split("(Begins)");