Description
Gitea before 1.16.7 does not escape git fetch remote.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | gitea | 1.16.7-r0 | — |
| Alpine v3.23 | gitea | 1.16.7-r0 | — |
| Alpine v3.22 | gitea | 1.16.7-r0 | — |
| Alpine v3.21 | gitea | 1.16.7-r0 | — |
| Alpine v3.20 | gitea | 1.16.7-r0 | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | gitea | 1.16.7-r0 | — |
| Alpine v3.18 | gitea | 1.16.7-r0 | — |
| Alpine v3.17 | gitea | 1.16.7-r0 | — |
| Alpine v3.16 | gitea | 1.16.7-r0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
Gitea Git Fetch Remote Code Execution
exploit/multi/http/gitea_git_fetch_rce
Exploit-DB 1
- Gitea 1.16.6 - Remote Code Execution (RCE) (Metasploit) EDB-51009 · webapps · Sep 15, 2022 · verified
GitHub 2 repositories
-
wuhan005/CVE-2022-30781 ★ 86 · May 22, 2022
🍵 Gitea repository migration remote command execution exploit.
-
403ArkhamS3c/cve-gitea ★ 1 · Oct 28, 2026
CVE-2022-30781
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Go | code.gitea.io/gitea | < 1.16.7 | 1.16.7 | GHSA-p5f9-c9j9-g8qx |
References
- https://github.com/go-gitea/gitea/pull/19490
- https://github.com/go-gitea/gitea/pull/19487
- https://blog.gitea.io/2022/05/gitea-1.16.7-is-released/
- http://packetstormsecurity.com/files/168400/Gitea-1.16.6-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/169928/Gitea-Git-Fetch-Remote-Code-Execution.html