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:",d,"\nresponse:",S,"\nresult:",U),this.spinner.stop(),g(U,N,P,R))}),F)}),F,mxUtils.bind(this,function(N){3>q++?v.clear()&&(this.spinner.stop(),t()):F(N)}))}),F);else{var G={message:mxResources.get("error")+" "+I.getStatus()};try{G=JSON.parse(I.getText()),G=G.error}catch(S){}F(G)}}),F)}),n)});t()};EditorUi.prototype.extractMermaidMindmap=function(d){for(0<d[1].indexOf("orientation")&&d.splice(1,1);1<d.length&&""==d[1];)d.splice(1,1);