fix: add serverside check against endless loops

pull/2693/head
Peace 1 year ago
parent 66573934f6
commit 9286dcb6ce
No known key found for this signature in database
GPG Key ID: 0EF6B46E172B739F

@ -674,6 +674,14 @@ let needSetup = false;
throw new Error("Permission denied.");
}
// Check if Parent is Decendant (would cause endless loop)
if (monitor.parent !== null) {
const childIDs = await Monitor.getAllChildrenIDs(monitor.id);
if (childIDs.includes(monitor.parent)) {
throw new Error("Invalid Monitor Group");
}
}
// Reset Prometheus labels
server.monitorList[monitor.id]?.prometheus()?.remove();

Loading…
Cancel
Save