Skip to content

Commit c636608

Browse files
authored
Dont leak private users via extensions (#28023)
1 parent 089ac06 commit c636608

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)