Security check when posting task config

This commit is contained in:
amcmanu3 2024-05-26 18:37:20 -04:00
parent caf35a6de8
commit b8681c0fce

View File

@ -113,6 +113,18 @@ class ApiServersServerTasksIndexHandler(BaseApiHandler):
)
if "parent" not in data:
data["parent"] = None
if data.get("action_id"):
backup_config = self.controller.management.get_backup_config(
data["action_id"]
)
if backup_config["server_id"]["server_id"] != server_id:
return self.finish_json(
405,
{
"status": "error",
"error": "Server ID Mismatch",
},
)
task_id = self.tasks_manager.schedule_job(data)
self.controller.management.add_to_audit_log(