gitforge/routers/private
Mathieu Fenniak c1c02f7111 fix: don't cache write permission on first pushed git reference (#13370)
Forgejo's git pre-receive hook validates whether the authenticated user can write to the target branch during a push operation.  A caching performance optimization in the hook caused the pre-receive hook to validate only the first branch reference in the push.  While typically a push operation has the same rights for all branches on a repository, some exceptions exist which could allow a user to push to a branch, pass the validation, and then bypass checks on additional references due to the cache.  The cache has been removed, forcing all references to be validated for code write permissions.

Thanks to Gitea for identifying this issue in https://github.com/go-gitea/gitea/pull/38103/changes/f25811942cea35233299efdbdfeec40663d4807a. This effort has been re-engineered for Forgejo, consistent with Forgejo's AI Agreement.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13370
Reviewed-by: Beowulf <beowulf@beocode.eu>
2026-07-09 06:07:05 +02:00
..
tests/repos
actions.go fix: ensure runners either belong to owner or repo when updated (#13262) 2026-07-01 03:49:07 +02:00
actions_test.go fix: ensure runners either belong to owner or repo when updated (#13262) 2026-07-01 03:49:07 +02:00
default_branch.go chore: remove branding from context imports (#9628) 2025-10-11 01:52:51 +02:00
hook_post_receive.go fix: introduce lint-single-response to prevent control flow continuing past a ctx.Error(...)-style method (#13087) 2026-06-14 17:06:03 +02:00
hook_post_receive_test.go
hook_pre_receive.go fix: don't cache write permission on first pushed git reference (#13370) 2026-07-09 06:07:05 +02:00
hook_proc_receive.go chore: remove branding from context imports (#9628) 2025-10-11 01:52:51 +02:00
hook_verification.go
hook_verification_test.go
internal.go Update module github.com/go-chi/chi/v5 to v5.3.0 (forgejo) (#12697) 2026-06-29 23:35:12 +02:00
internal_repo.go chore: remove branding from context imports (#9628) 2025-10-11 01:52:51 +02:00
key.go
mail.go
main_test.go
manager.go fix: introduce lint-single-response to prevent control flow continuing past a ctx.Error(...)-style method (#13087) 2026-06-14 17:06:03 +02:00
manager_process.go
manager_unix.go
restore_repo.go chore: ensure consistent import aliasing for services and models (#10253) 2025-11-30 17:00:57 +01:00
serv.go fix: introduce lint-single-response to prevent control flow continuing past a ctx.Error(...)-style method (#13087) 2026-06-14 17:06:03 +02:00
ssh_log.go