CVE-2022-30781
Shell command injection in gitea
Gitea before 1.16.7 does not escape git fetch remote.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
7.5
Gitea before 1.16.7 does not escape git fetch remote.
- Record
CVE-2022-30781- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:P/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
CVE List No score
Gitea before 1.16.7 does not escape git fetch remote.
- Record
CVE-2022-30781- Updated
- 2026-11-02
EUVDEUVD-2022-4684 No score
Gitea before 1.16.7 does not escape git fetch remote.
- Record
EUVD-2022-4684- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-p5f9-c9j9-g8qx
7.5
Shell command injection in gitea
Gitea before 1.16.7 does not escape the shell out for git fetch remote allowing for shell command injection
- Record
GHSA-p5f9-c9j9-g8qx- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
OSVALPINE-CVE-2022-30781
7.5
Gitea before 1.16.7 does not escape git fetch remote.
- Record
ALPINE-CVE-2022-30781- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-03
OSVGHSA-p5f9-c9j9-g8qx
7.5
Shell command injection in gitea
Gitea before 1.16.7 does not escape the shell out for git fetch remote allowing for shell command injection
- Record
GHSA-p5f9-c9j9-g8qx- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-116
- Updated
- 2026-11-02
OSVBIT-gitea-2022-30781 No score
Gitea before 1.16.7 does not escape git fetch remote.
- Record
BIT-gitea-2022-30781- Updated
- 2026-11-02
OSV No score
Gitea before 1.16.7 does not escape git fetch remote.
- Record
CVE-2022-30781- Updated
- 2026-11-02
OSVGO-2022-0450 No score
Shell command injection in gitea in code.gitea.io/gitea
Shell command injection in gitea in code.gitea.io/gitea
- Record
GO-2022-0450- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
code.gitea.io/giteaGo |
before 1.16.7 | 1.16.7 |
giteaAlpine:v3.16 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.17 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.18 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.19 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.20 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.21 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.22 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.23 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaAlpine:v3.24 |
before 1.16.7-r0 | 1.16.7-r0 |
giteaBitnami |
before 1.16.7 | 1.16.7 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| Metasploit | Gitea Git Fetch Remote Code Execution | 2022-05-16 |
| PoC in GitHub | wuhan005/CVE-2022-30781 | 2022-05-22 |
| Exploit-DB | Gitea 1.16.6 - Remote Code Execution (RCE) (Metasploit) | 2022-09-15 |
| PoC in GitHub | 403ArkhamS3c/cve-gitea | 2026-10-28 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, exploits, references | OSV | |
| aliases | EUVD | |
| first indexed | CVE List, Exploit-DB, GitHub Advisories, Metasploit, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-30781 is a high vulnerability (CVSS 7.5) in Gitea, published May 16, 2022. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 87.9%, the 99th percentile. Fixed in code.gitea.io/gitea 1.16.7.
References
github.com/go-gitea/gitea/pull/19490
github.com/go-gitea/gitea/pull/19487
blog.gitea.io/2022/05/gitea-1.16.7-is-released
packetstormsecurity.com/files/168400/Gitea-1.16.6-Remote-Code-Execution.html
packetstormsecurity.com/files/169928/Gitea-Git-Fetch-Remote-Code-Execution.html
nvd.nist.gov/vuln/detail/CVE-2022-30781