← Vulnerability feed

Vulnerability record · CVE-2022-30781 · published 16 May 2022

CVE-2022-30781: Gitea git fetch remote escaping flaw enables remote code execution

Gitea · Gitea

Gitea before 1.16.7 does not escape the git fetch remote, allowing crafted input to reach command execution paths. The record is thin on technical detail, but the flaw is network-reachable and integrity-impacting, and public exploit write-ups exist. It matters because Gitea is a self-hosted code host, so compromise can expose repositories and credentials.

7.5 CVSS 3.1 High EPSS 88% · top 0.2% CWE-116 · CWE-116
7.5CVSS 3.1 base score, v2 5.0
88%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
10References, 4 tagged exploit
17 Jun 2026Last modified by NVD

Description

Gitea before 1.16.7 does not escape git fetch remote.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: medium.

high priorityNetwork-reachable, no authentication or interaction required per the vector, public exploit write-ups exist, and EPSS is near the top percentile, though KEV does not list it.

What it is

Gitea before 1.16.7 does not escape the git fetch remote, allowing crafted input to reach command execution paths. The record is thin on technical detail, but the flaw is network-reachable and integrity-impacting, and public exploit write-ups exist. It matters because Gitea is a self-hosted code host, so compromise can expose repositories and credentials.

Impact

An attacker can achieve remote code execution on the Gitea server, gaining control of the host and any repositories, tokens or credentials it holds. The CVSS vector shows no confidentiality impact, but integrity is rated high, consistent with code or command execution.

Attack surface

Reached over the network via the git fetch remote functionality; the CVSS vector indicates no privileges and no user interaction are required. The description does not state which endpoint or role is needed, so that detail is missing.

Exploitation

Not listed in CISA KEV, but EPSS is very high (0.89361, 99.775th percentile) and multiple references are tagged Exploit, including Packet Storm remote code execution write-ups. This indicates public exploit material exists, though the record does not confirm active in-the-wild use.

What to do

  • Upgrade Gitea to 1.16.7 or later, which contains the escaping fix.
  • If immediate upgrade is not possible, restrict network access to the Gitea instance and limit who can trigger git fetch remote operations.
  • Review the patch pull requests (19487, 19490) to understand the escaping change and check for equivalent gaps in custom integrations.
  • Rotate credentials, tokens and SSH keys stored or used by the Gitea server if compromise is suspected.
  • Monitor Gitea release notes for follow-up fixes in the same area.

Detection

  • Alert on unexpected child processes spawned by the Gitea service account, especially shell or git commands with unusual arguments.
  • Monitor Gitea application and web server logs for git fetch remote requests containing shell metacharacters or unusual remote URLs.
  • Baseline outbound network connections from the Gitea host and flag connections to unknown or untrusted remotes.
  • Watch for new files, cron entries or SSH authorized_keys changes on the Gitea host.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2022-30781 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

9.8CVE-2026-60004Gitea diffpatch API code injection enables remote code executionGitea before 1.27.1 allows remote code execution through the diffpatch API by way of Git hook installation. The flaw is a code injection issue (CWE-9…KEVEPSS 24%analysed9.8CVE-2022-42968Gitea argument injection vulnerabilityGitea before 1.17.3 does not sanitize and escape refs in the git backend. Arguments to git commands are mishandled.EPSS 1.2%9.8CVE-2021-45331Gitea improper authentication vulnerabilityAn Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for…EPSS 1.4%9.8CVE-2021-45330Gitea vulnerabilityAn issue exsits in Gitea through 1.15.7, which could let a malicious user gain privileges due to client side cookies not being deleted and the sessio…EPSS 1.4%9.8CVE-2021-45327Gitea interpretation conflict vulnerabilityGitea before 1.11.2 is affected by Trusting HTTP Permission Methods on the Server Side when referencing the vulnerable admin or user API. which could…EPSS 2.1%9.8CVE-2020-28991Gitea vulnerabilityGitea 0.9.99 through 1.12.x before 1.12.6 does not prevent a git protocol path that specifies a TCP port number and also contains newlines (with URL …EPSS 1.7%9.8CVE-2019-11576Gitea improper authentication vulnerabilityGitea before 1.8.0 allows 1FA for user accounts that have completed 2FA enrollment. If a user's credentials are known, then an attacker could send th…EPSS 1.8%9.8CVE-2018-18926Gitea vulnerabilityGitea before 1.5.4 allows remote code execution because it does not properly validate session IDs. This is related to session ID handling in the go-m…EPSS 3.0%

Source: NIST National Vulnerability Database (record CVE-2022-30781), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.