Skip to content

Commit 69ea554

Browse files
authored
Dont leak private users via extensions (#28023) (#28028)
Backport #28023 by @6543 there was no check in place if a user could see a other user, if you append e.g. `.rss`
1 parent c077a08 commit 69ea554

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

0 commit comments

Comments
 (0)