Language: JavaScript
Label: safe
CWE: CWE-668 \u2014 Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.

Code:
function confirmAjaxAction(action, service, id) {
	var cancel_word = $('#translate').attr('data-cancel');
	var action_word = $('#translate').attr('data-'+action);
	$( "#dialog-confirm" ).dialog({
		resizable: false,
		height: "auto",
		width: 400,
		modal: true,
		title: action_word + " " + id + "?",
		buttons: [{
			text: action_word,
			click: function () {
				$(this).dialog("close");
				if (service == "haproxy") {
					ajaxActionServers(action, id);
					if (action == "restart" || action == "reload") {
						if (localStorage.getItem('restart')) {
							localStorage.removeItem('restart');
							$("#apply").css('display', 'none');
						}
					}
				} else if (service == "waf") {
					ajaxActionWafServers(action, id)
				} else if (service == "nginx") {
					ajaxActionNginxServers(action, id)
				} else if (service == "keepalived") {
					ajaxActionKeepalivedServers(action, id)
				} else if (service == "apache") {
					ajaxActionApacheServers(action, id)
				} else if (service == "waf_nginx") {
					ajaxActionWafNginxServers(action, id)
				}
			}
		}, {
			text: cancel_word,
			click: function() {
				$( this ).dialog( "close" );
			}
		}]
	});
}