jojo/services/pull
Mathieu Fenniak 3653b34ec7 [v14.0/forgejo] fix: verify PR author has write access to head to support allow maintainers edit (#12294)
Backport: https://codeberg.org/forgejo/forgejo/pulls/12292

When a pull request is opened, the author is able to mark that pull request to "Allow edits from maintainers", which grants the maintainers of the pull request's repo access to edit the pull request branch contents.  It is possible to create a pull request where the pull request author does not have the ability to edit the pull request branch.  Due to a missing security check for this case, maintainers of the pull request repo would be granted the ability to edit the pull request branch, even if the author of the pull request did not have that ability.  By exploiting this missing security check, a user can edit any branch in a repository if they're able to fork that repository.  The issue is being fixed by restricting the scope of "Allow edits from maintainers" to only grant that access if the pull request author also had access to edit the branch.

Thanks to Arvin Shivram of Brutecat Security for discovering and responsibly disclosing the vulnerability.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12294
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2026-04-29 05:29:23 +02:00
..
check.go chore: move code for manual merges into merge_manual.go (#10141) 2025-11-28 07:57:31 +01:00
check_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
comment.go feat: Use receive.hideRefs (#10015) 2025-11-10 14:36:15 +01:00
commit_status.go [v14.0/forgejo] fix: correctly compute required commit status (#10788) 2026-01-12 13:05:58 +01:00
commit_status_test.go [v14.0/forgejo] fix: correctly compute required commit status (#10788) 2026-01-12 13:05:58 +01:00
edits.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
lfs.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go [v14.0/forgejo] chore(cleanup): move all test blank imports in a single package (#10672) 2026-01-05 12:14:11 +01:00
merge.go fix: allow for merge message template with empty message (#9930) 2025-12-10 19:57:19 +01:00
merge_ff_only.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
merge_manual.go chore: move code for manual merges into merge_manual.go (#10141) 2025-11-28 07:57:31 +01:00
merge_merge.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
merge_prepare.go fix: short-circuit to avoid rebasing (#8622) 2025-07-23 07:30:30 +02:00
merge_rebase.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
merge_squash.go Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.6.1 (forgejo) (#10053) 2025-11-11 07:04:35 +01:00
merge_test.go fix: allow for merge message template with empty message (#9930) 2025-12-10 19:57:19 +01:00
patch.go feat: improve checking if diffs differ (#8451) 2025-07-16 18:19:27 +02:00
patch_test.go feat: improved performances when checking for conflicts on pull requests (#7727) 2025-05-16 12:40:38 +00:00
patch_unmerged.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pull.go [v14.0/forgejo] fix: verify PR author has write access to head to support allow maintainers edit (#12294) 2026-04-29 05:29:23 +02:00
pull_test.go fix: allow for merge message template with empty message (#9930) 2025-12-10 19:57:19 +01:00
review.go fix: pull request review comment position (#9914) 2025-10-31 16:17:23 +01:00
review_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
temp_repo.go feat: bump the minimum required Git version from 2.0.0 to 2.34.1 (#8328) 2025-06-29 00:44:18 +02:00
update.go 2025-11-21 combined security patches (#10037) 2025-11-21 05:23:43 +01:00
update_rebase.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00