mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 17:50:12 +00:00
fix(controller): validate trigger task ownership
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -545,5 +545,14 @@ func validateServers(c *gin.Context, ss *model.Service) error {
|
||||
return singleton.Localizer.ErrorT("permission denied")
|
||||
}
|
||||
|
||||
// Trigger task IDs are user-controlled; validate them here so services cannot
|
||||
// reference another user's cron and later execute it from the sentinel path.
|
||||
if !singleton.CronShared.CheckPermission(c, slices.Values(ss.FailTriggerTasks)) {
|
||||
return singleton.Localizer.ErrorT("permission denied")
|
||||
}
|
||||
if !singleton.CronShared.CheckPermission(c, slices.Values(ss.RecoverTriggerTasks)) {
|
||||
return singleton.Localizer.ErrorT("permission denied")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user