Skip to content

Commit

Permalink
Dont leak private users via extensions (#28023)
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored Nov 13, 2023
1 parent 089ac06 commit c636608
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions routers/web/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ func UsernameSubRoute(ctx *context.Context) {
reloadParam := func(suffix string) (success bool) {
ctx.SetParams("username", strings.TrimSuffix(username, suffix))
context_service.UserAssignmentWeb()(ctx)
// check view permissions
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
return false
}
return !ctx.Written()
}
switch {
Expand Down

0 comments on commit c636608

Please sign in to comment.