CVE-2022-42968 Gitea vulnerable to Argument Injection

Critical 9.8 Published Updated

Attackers can execute arbitrary commands via unsanitized git refs in Gitea, requiring an upgrade to secure the service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-42968?

CVE-2022-42968 is a critical command injection vulnerability in Gitea Gitea, published on 16 Oct 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Gitea before 1.17.3 does not sanitize and escape refs in the git backend. Arguments to git commands are mishandled.

Weakness: CWE-88

Which versions are affected by CVE-2022-42968?

4 open source packages ship an affected version, including github.com/go-gitea/gitea, gitea and code.gitea.io/gitea. It affects 1 product.

PackageAffectedFixed in
github.com/go-gitea/gitea GoAll versions1.17.3
github.com/go-gitea/gitea GoAll versions1.17.3
gitea BitnamiAll versions1.17.3
code.gitea.io/gitea GoAll versions1.17.3

Products include Gitea Gitea.

How do I fix CVE-2022-42968?

Upgrade github.com/go-gitea/gitea to 1.17.3 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2022-42968 being exploited?

There is no known exploitation of CVE-2022-42968 in the wild and no public exploit code.

All Gitea Gitea vulnerabilities

Sources

Also known as BIT-gitea-2022-42968, CLEANSTART-2025-JO83815, GHSA-w8xw-7crf-h23x, GO-2022-1065.

Is CVE-2022-42968 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free