CVE-2022-42968: Gitea Refs Mishandling Vulnerability

gitea Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Critical
Not published

CVE-2022-42968: Gitea before 1.17.3 does not sanitize and escape refs in the git backend. Arguments to git commands are mishandled. Affects gitea versions < 1.17.3. Fixed in 1.17.3. How to fix ↓

Also tracked for

The same CVE-2022-42968 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Gitea is an open-source self-hosted Git service that provides a lightweight interface for managing repositories, users, and organizations. It is widely used for version control and collaboration in software development projects. This vulnerability affects Gitea versions prior to 1.17.3.

Vulnerability Detail

The vulnerability in Gitea arises from the lack of proper sanitization and escaping of refs in the git backend. This allows for the mishandling of arguments to git commands, potentially leading to unauthorized access, code execution, and other security issues. Attackers can exploit this vulnerability to manipulate git commands and gain unauthorized access to sensitive data or execute arbitrary code on the affected system.

How To Fix

Minimum fixed version

1.17.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to apply the recommended fix by upgrading to the patched version of Gitea.

Conclusion

The Gitea Refs Mishandling Vulnerability (CVE-2022-42968) poses a significant risk to systems running affected versions of Gitea. It is crucial to upgrade to Gitea version 1.17.3 or later to mitigate this vulnerability. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for gitea →

Share this vulnerability

FAQ

Gitea is a self-hosted Git service that provides a lightweight interface for managing repositories, users, and organizations.

This vulnerability allows attackers to manipulate git commands and potentially gain unauthorized access to sensitive data or execute arbitrary code on the affected system.

To fix this vulnerability, it is recommended to upgrade Gitea to version 1.17.3 or later.

There are no known workarounds for this vulnerability. It is crucial to apply the recommended fix by upgrading to the patched version of Gitea.

For more information about this vulnerability, you can refer to the CVE identifier CVE-2022-42968 or the GitHub Security Advisory GHSA-w8xw-7crf-h23x.

Related vulnerabilities

Recent vulnerabilities recorded for gitea.

How To Fix

Minimum fixed version

1.17.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback