Critical Gogs Vulnerability Exposes Servers to Remote Code Execution and 2FA Bypass

Listen to this Post

Featured Image
A newly discovered, severe vulnerability in Gogs, a lightweight self-hosted Git service, has sent shockwaves through the developer community. The flaw allows attackers not only to execute commands remotely but also to bypass two-factor authentication (2FA), putting private code repositories at serious risk. With organizations increasingly relying on self-hosted Git solutions for sensitive projects, this discovery underscores the dangers of incomplete security fixes and outdated software.

Vulnerability Overview

Gogs versions up to 0.13.3 are affected by CVE-2025-64111, a critical OS command injection vulnerability rated CVSS 9.3. This flaw originates from an incomplete patch for a previous issue, enabling attackers to manipulate the .git/config file through the repository PUT contents API.

The attack works in several stages:

An attacker with repository push access creates a symbolic link to .git/config using a command like:

bash

Copy code

ln -s .git/config link

The attacker commits and pushes this symlink.

A crafted PUT request to /api/v1/repos/{owner}/{repo}/contents/link sends a base64-encoded malicious Git configuration, such as custom SSH commands (sshCommand = touch /tmp/abc) or remote definitions.

The

Beyond this critical flaw, Gogs is also vulnerable to other high-risk issues:

CVE-2025-64175 (CVSS 7.7): Attackers can bypass 2FA by using their own recovery codes to access any account if they already know credentials.

CVE-2026-24135 (CVSS 7.2): Authenticated users can delete arbitrary files via wiki path traversal.

CVE ID Severity (CVSS) Description Affected Versions Patched Versions CWE
CVE-2025-64111 Critical (9.3) RCE via .git/config API update <=0.13.3 0.13.4, 0.14.0+dev 78
CVE-2025-64175 High (7.7) 2FA recovery code cross-account bypass <=0.13.3 0.13.4, 0.14.0+dev N/A
CVE-2026-24135 High (7.2) Path traversal file deletion in wiki <=0.13.3 0.13.4, 0.14.0+dev N/A

Security experts urge organizations to upgrade immediately to Gogs 0.13.4 or 0.14.0+dev, disable public repository access, enforce strong authentication measures, and closely monitor API endpoints. For long-term stability, migrating to Gitea, an active fork of Gogs with better security maintenance, is recommended. While no public exploits have appeared yet, proof-of-concept code exists, making this vulnerability easy to weaponize.

This incident highlights the broader risks associated with self-hosted Git services. Prompt patching and vigilant monitoring are essential to prevent complete server takeovers in development and production environments.

What Undercode Say:

This Gogs vulnerability illustrates a recurring problem in self-hosted developer tools: the danger of incomplete or rushed security patches. Attackers are increasingly leveraging API endpoints that were never fully hardened, exploiting both human and software weaknesses. The .git/config injection is particularly dangerous because it blends traditional code injection with the subtlety of Git operations, making detection difficult.

Organizations relying on self-hosted Git services must recognize that access controls alone are insufficient. Even users with limited push privileges can trigger server-level RCE, demonstrating that internal threat vectors are just as critical as external ones. The 2FA bypass further amplifies risk, showing how layered security can be undermined by overlooked recovery mechanisms.

The timeline of vulnerability discovery suggests that many Gogs users may have already been exposed without realizing it. Unlike cloud-hosted alternatives, self-hosted software puts the responsibility for patching squarely on the organization. Companies that delay updates face exponential risk, as attackers can combine multiple vulnerabilities (RCE + 2FA bypass + path traversal) to gain complete system access.

From a security posture perspective, the Gogs flaws reinforce the importance of:

Automated patch management: Ensuring all repositories run supported versions.

API monitoring and logging: Detecting abnormal PUT/POST requests.

Segregation of privileges: Limiting repository push access to trusted personnel only.

Migration planning: Considering alternatives like Gitea that actively maintain security.

The technical sophistication of this attack also signals a shift in threat modeling. Self-hosted tools, previously assumed to be safer behind corporate firewalls, are now prime targets for attackers exploiting subtle API gaps. Security teams need to adopt proactive auditing of repository APIs, symlink handling, and configuration management to prevent similar exploit chains.

In addition, the proof-of-concept for .git/config injection demonstrates how attackers increasingly combine social engineering, developer privileges, and API flaws. This means even minor oversights in repository configuration or recovery code management can become gateways for full server compromise. For companies operating in highly regulated environments, the reputational and operational risks are significant.

Overall, the Gogs incidents highlight a broader industry trend: self-hosted developer tools are no longer inherently secure, and assumptions about internal trust boundaries must be revisited. Security-conscious organizations should consider automated monitoring, stricter access control, and migration to actively maintained forks or managed services.

Fact Checker Results:

✅ CVE-2025-64111 is confirmed as a critical RCE vulnerability in Gogs <=0.13.3.

✅ CVE-2025-64175 allows cross-account 2FA bypass using recovery codes.

✅ CVE-2026-24135 confirms path traversal enabling wiki file deletion.

Prediction:

📌 Expect a rapid adoption of Gogs forks like Gitea in enterprise environments.
📌 Security researchers will likely release weaponized PoCs within months, increasing pressure on organizations to patch immediately.
📌 Attackers may increasingly target internal, self-hosted developer tools, leveraging overlooked API weaknesses for lateral movement and server compromise.

If you want, I can also create a visual flow diagram showing how the .git/config RCE attack unfolds—it would make this technical exploit much easier to grasp for developers. Do you want me to do that?

🕵️‍📝✔️Let’s dive deep and fact‑check.

References:

Reported By: cyberpress.org
Extra Source Hub (Possible Sources for article):
https://www.facebook.com
Wikipedia
OpenAi & Undercode AI

Image Source:

Unsplash
Undercode AI DI v2
Bing

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow UndercodeNews & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin | 🦋BlueSky | 🐘Mastodon