Skip to content

Commit 34e22fd

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

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
@@ -822,6 +822,11 @@ func UsernameSubRoute(ctx *context.Context) {
822822
reloadParam := func(suffix string) (success bool) {
823823
ctx.SetParams("username", strings.TrimSuffix(username, suffix))
824824
context_service.UserAssignmentWeb()(ctx)
825+
// check view permissions
826+
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
827+
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
828+
return false
829+
}
825830
return !ctx.Written()
826831
}
827832
switch {

0 commit comments

Comments
 (0)