mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
#3057 retrieve webhook with repo_id
This prevents user retrieve arbitrary webhook by changing URL to access webhook from other unauthorized repositories.
This commit is contained in:
@ -220,7 +220,7 @@ func checkWebhook(ctx *context.Context) (*OrgRepoCtx, *models.Webhook) {
|
||||
}
|
||||
ctx.Data["BaseLink"] = orCtx.Link
|
||||
|
||||
w, err := models.GetWebhookByID(ctx.ParamsInt64(":id"))
|
||||
w, err := models.GetWebhookByID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
if models.IsErrWebhookNotExist(err) {
|
||||
ctx.Handle(404, "GetWebhookByID", nil)
|
||||
|
Reference in New Issue
Block a user