Skip to content

Commit

Permalink
Dont leak private users via extensions (go-gitea#28023) (go-gitea#28029)
Browse files Browse the repository at this point in the history
Backport go-gitea#28023 by @6543

there was no check in place if a user could see a other user, if you
append e.g. `.rss`
  • Loading branch information
GiteaBot committed Nov 13, 2023
1 parent d412271 commit eef4148
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 eef4148

Please sign in to comment.