Skip to content

Commit

Permalink
Dont leak private users via extensions (go-gitea#28023)
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored and fuxiaohei committed Jan 17, 2024
1 parent 582aca8 commit 076d08b
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 076d08b

Please sign in to comment.