Skip to content

Commit b446378

Browse files
6543GiteaBot
authored andcommitted
Dont leak private users via extensions (go-gitea#28023)
1 parent c077a08 commit b446378

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

routers/web/user/home.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,11 @@ func UsernameSubRoute(ctx *context.Context) {
821821
reloadParam := func(suffix string) (success bool) {
822822
ctx.SetParams("username", strings.TrimSuffix(username, suffix))
823823
context_service.UserAssignmentWeb()(ctx)
824+
// check view permissions
825+
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
826+
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
827+
return false
828+
}
824829
return !ctx.Written()
825830
}
826831
switch {

0 commit comments

Comments
 (0)