fix(security): 403 Access Denied for signed-in users on private repos #420

Merged
jmiller merged 1 commits from dev into main 2026-06-02 14:27:25 +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
}