Language: JavaScript
Label: vulnerable
CWE: CWE-918 \u2014 Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

Code:
    var openInline = function(editor){
        status = !status;
        var $main = $(editor.editorContainer);
        var form  = editor.formCode;
        if(!form){
            var $to = $main.find('.tox-sidebar-wrap');
            var data = {
                formStyle:{"className":"form-box-title-block toc-form-code-editor"},
                code:{type:'codeEditor'}
            };
            $('<div class="toc-editor-source hidden"></div>').appendTo($to);
            form = new kodApi.formMaker({formData:data});
            form.renderTarget($main.find('.toc-editor-source'));
            $main.find('.form-target-save').hide();
            
            form.bind('onSave',function(data){
                setContent(editor,data.code);
            });
            editor.formCode = form;
        }
        var $area = $main.find('.toc-editor-source');
        var $btn  = $main.find('.tox-tbtn.toolbar-codeView');
        if(status){
            $btn.addClass('tox-tbtn--enabled');
            $area.removeClass('hidden');
            $main.find('.tox-tbtn,.tox-mbtn,.tox-split-button').not($btn).addClass('tox-btn-disable');
        }else{
            $btn.removeClass('tox-tbtn--enabled');
            $area.addClass('hidden');
            $main.find('.tox-tbtn,.tox-mbtn,.tox-split-button').removeClass('tox-btn-disable');
        }
        
        var html = editor.getContent({source_view:true});
        if(status){
            form.setValue('code',html);
            var aceEditor = $main.find(".ace_editor").data('editor');
            if(aceEditor){
                // aceEditor.execCommand('phpBeautify');
            }
        }else{
            var theData = form.getValue();
            if(theData.code){
                setContent(editor,theData.code);
            }
        }
        editor.formCode = form;
    }