CVE-2026-26231:
취약성 분석 및 완화
개요
CVE-2026-26231 is an authorization bypass vulnerability in Gitea titled "Authorization Bypass via 'Allow edits from maintainers' allows unauthorized commits to any readable repo." Any authenticated low-privilege user with read access to a repository can push arbitrary commits directly to that repository, bypassing all write-access checks. It affects Gitea versions up to and including 1.26.1, with the patch released in version 1.26.2. The advisory was first published on June 5, 2026, and added to the GitHub Advisory Database on June 16, 2026. It carries a CVSS v3.1 base score of 8.5 (High) (Github Advisory, Gitea Advisory).
기술적 세부 사항
The vulnerability is classified as CWE-863 (Incorrect Authorization) and stems from two missing validation checks in Gitea's pull request and push handling logic. First, the web UI PR-create endpoint sets allow_maintainer_edit=true without verifying that the submitter has write access to the HEAD repository. Second, when SupportProcReceive is enabled, Gitea relaxes the required push access mode to Read (in routers/web/repo/githttp.go and routers/private/serv.go) and defers enforcement to the pre-receive hook. The pre-receive hook's CanMaintainerWriteToBranch function (in models/issues/pull_list.go) then checks write access against the BASE repository — which is the attacker's own fork — rather than the upstream HEAD repository, allowing the push to succeed. A public proof-of-concept Python script (poc.py) is included in the advisory and demonstrates full exploitation (Github Advisory, Gitea Advisory).
영향
Successful exploitation results in full repository compromise: any authenticated user — including those with only read access — can push arbitrary commits to any readable repository on the Gitea instance, including all public repositories. This allows attackers to backdoor source code, inject malicious dependencies, tamper with release artifacts, or corrupt project history without any write permissions. The integrity impact is high, with a secondary low confidentiality impact (e.g., access to repository metadata during the exploit flow), and the scope is changed since the attacker's actions affect resources beyond their own fork (Github Advisory).
착취 단계
- Reconnaissance: Identify a target Gitea instance running version ≤ 1.26.1. Enumerate public or readable repositories that the attacker does not have write access to.
- Fork the target repository: Using a low-privilege attacker account, fork the victim's repository (e.g.,
victim/repo) to createattacker/repo_pocfork. - Create a reverse-fork PR: Navigate to the web compare endpoint and create a pull request with BASE =
attacker/repo_pocfork(the attacker's fork) and HEAD =victim/repo(the upstream target). Enable the "Allow edits from maintainers" checkbox. This setsAllowMaintainerEdit=trueagainst the upstream HEAD without verifying write access. - Clone the fork and make a malicious commit: Clone
attacker/repo_pocforklocally, add a malicious file or code change (e.g.,PWNED.txtor a backdoored dependency), and commit it. - Push to the upstream: Run
git pushtargeting the upstream repository URL (e.g.,http://gitea:3000/victim/repo.git). Gitea's pre-receive hook callsCanMaintainerWriteToBranch, finds the malicious PR withAllowMaintainerEdit=true, checks write access against the BASE (attacker's fork), and incorrectly authorizes the push. - Confirm compromise: The commit appears on the upstream repository's default branch, committed by the attacker account with no legitimate write access. This can be automated using the provided
poc.pyscript:python3 poc.py --repo http://gitea:3000/victim/repo --user attacker --password attacker_pass(Github Advisory, Gitea Advisory).
타협의 징후
- Logs: Gitea access logs showing a
git push(HTTP POST to/victim/repo.git/git-receive-pack) from a user account that has no write permissions to the target repository; SSH push events from low-privilege users to repositories they do not own. - Logs: Pull request creation logs showing a PR where BASE is a fork owned by the pusher and HEAD is an upstream repository the pusher does not have write access to, with
allow_maintainer_edit=true. - Repository Activity: Unexpected commits appearing on a repository's default branch authored by accounts that are not listed as collaborators or contributors with write access; commit messages such as
'PoC: unauthorized commit via maintainer-edit bypass'or unexpected files likePWNED.txt. - Network: HTTP POST requests to
/compareor PR-creation endpoints withallow_maintainer_edit=trueparameters from low-privilege user accounts, followed shortly by push requests to upstream repositories. - File System: Unexpected new files or modified source files (e.g., backdoored dependencies, injected scripts) in repository working trees on the Gitea server (Github Advisory).
완화 및 해결 방법
Gitea has released version 1.26.2 which patches this vulnerability; all users running version 1.26.1 or earlier should upgrade immediately. The fix requires two independent checks: (1) at PR creation, verify the submitter has write access to the HEAD repository before setting AllowMaintainerEdit=true; and (2) in CanMaintainerWriteToBranch, verify that the PR's HEAD repo matches the repository being pushed to and that the PR was opened by a legitimate owner or writer of the HEAD repository. No configuration-based workaround is documented; upgrading to 1.26.2 is the only recommended remediation (Github Advisory, Gitea Advisory).
커뮤니티 반응
The advisory was published by Gitea maintainer lunny on June 5, 2026, and added to the GitHub Advisory Database on June 16, 2026. The Gitea release blog announced version 1.26.2 as the patched release. No significant broader media coverage or notable independent researcher commentary has been identified beyond the official advisory at this time (Gitea Release Blog, Github Advisory).
추가 자료
근원: 이 보고서는 AI를 사용하여 생성되었습니다.
무료 취약성 평가
클라우드 보안 태세를 벤치마킹합니다
9개의 보안 도메인에서 클라우드 보안 관행을 평가하여 위험 수준을 벤치마킹하고 방어의 허점을 식별합니다.
추가 Wiz 리소스
맞춤형 데모 받기
맞춤형 데모 신청하기
"내가 본 최고의 사용자 경험은 클라우드 워크로드에 대한 완전한 가시성을 제공합니다."
"Wiz는 클라우드 환경에서 무슨 일이 일어나고 있는지 볼 수 있는 단일 창을 제공합니다."
"우리는 Wiz가 무언가를 중요한 것으로 식별하면 실제로 중요하다는 것을 알고 있습니다."