Language: JavaScript
Label: vulnerable
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:
			token: $('#token').val()
		},
		type: "POST",
		success: function (data) {
			data = data.replace(/\s+/g, ' ');
			if (data.indexOf('error:') != '-1') {
				toastr.error(data);
			} else {
				$("#dialog-settings-service").html(data)
				$( "input[type=checkbox]" ).checkboxradio();
				$("#dialog-settings-service").dialog({
					resizable: false,
					height: "auto",
					width: 400,
					modal: true,
					title: "Settings for " + name,
					buttons: {
						"Save": function () {
							$(this).dialog("close");
							serverSettingsSave(id, name, service, $(this));
						},
						Cancel: function () {
							$(this).dialog("close");
						}
					}
				});
			}
		}
	});
}