fix(sec): web route update and delete runner variables
The web route to update and delete variables of runners did not check if the ID that was given belonged to the context it was requested in, this made it possible to update and delete every existing runner variable of a instance for any authenticated user. The code has been reworked to always take into account the context of the request (owner and repository ID).
This commit is contained in:
parent
c324910c31
commit
77db7655e0
8 changed files with 34 additions and 28 deletions
|
@ -127,7 +127,7 @@ func VariableUpdate(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
shared.UpdateVariable(ctx, vCtx.RedirectLink)
|
||||
shared.UpdateVariable(ctx, vCtx.OwnerID, vCtx.RepoID, vCtx.RedirectLink)
|
||||
}
|
||||
|
||||
func VariableDelete(ctx *context.Context) {
|
||||
|
@ -136,5 +136,5 @@ func VariableDelete(ctx *context.Context) {
|
|||
ctx.ServerError("getVariablesCtx", err)
|
||||
return
|
||||
}
|
||||
shared.DeleteVariable(ctx, vCtx.RedirectLink)
|
||||
shared.DeleteVariable(ctx, vCtx.OwnerID, vCtx.RepoID, vCtx.RedirectLink)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue