Merge pull request 'fix(security): 403 Access Denied for signed-in users on private repos' (#420) from dev into main
Deploy MokoGitea / deploy (push) Has been cancelled

This commit was merged in pull request #420.
This commit is contained in:
2026-06-02 14:27:19 +00:00
+7
View File
@@ -435,6 +435,13 @@ func repoAssignmentLegacy(ctx *Context, data *repoAssignmentPrepareDataStruct) {
EarlyResponseForGoGetMeta(ctx)
return
}
// For signed-in users, show "access denied" instead of 404
// so they know the repo exists but they lack permission.
// Anonymous users still get 404 to prevent repo enumeration.
if ctx.IsSigned {
ctx.HTTPError(http.StatusForbidden, "You do not have permission to access this repository")
return
}
ctx.NotFound(nil)
return
}