forgejo/tests
Gergely Nagy aacc13fca8 hooks: Harden when we accept push options that change repo settings
It is possible to change some repo settings (its visibility, and
template status) via `git push` options: `-o repo.private=true`, `-o
repo.template=true`.

Previously, there weren't sufficient permission checks on these, and
anyone who could `git push` to a repository - including via an AGit
workflow! - was able to change either of these settings. To guard
against this, the pre-receive hook will now check if either of these
options are present, and if so, will perform additional permission
checks to ensure that these can only be set by a repository owner or
an administrator. Additionally, changing these settings is disabled for
forks, even for the fork's owner.

There's still a case where the owner of a repository can change the
visibility of it, and it will not propagate to forks (it propagates to
forks when changing the visibility via the API), but that's an
inconsistency, not a security issue.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Signed-off-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit 8eba631f8d)
2024-04-20 05:58:39 +00:00
..
e2e [TESTS] disable test failure on log.Error for now (part 2) 2024-04-16 10:28:48 +02:00
fuzz
gitea-lfs-meta
gitea-repositories-meta Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
integration hooks: Harden when we accept push options that change repo settings 2024-04-20 05:58:39 +00:00
testdata/data/attachments/a/0
mssql.ini.tmpl
mysql.ini.tmpl
pgsql.ini.tmpl
sqlite.ini.tmpl
test_utils.go fix(tests): 30s to cancel processes to avoid false negatives 2024-04-19 17:04:53 +02:00