mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Dont leak private users via extensions (#28023)
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user