External risk intelligence

Forgejo Unintended File Write Via Template Repositories

CVE advisorySeverity: CRITICAL (CVSS 9.5)

CVE-2025-68937

Forgejo is a self-hosted Git service typically deployed as a web application. Because it is designed to facilitate collaboration, code hosting, and repository management, these instances are frequently exposed to the public internet or accessible via wide-reaching corporate networks to allow developer access, making the web interface a common internet-facing service.

Halo Surface Signal: 4 out of 5 — likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

A critical vulnerability has been identified in Forgejo, a self-hosted Git service, that could allow unauthorized users to write to unintended files and potentially gain server control. This issue arises from how the system handles specific file operations within template repositories. While the main concern is confirming relevance and exposure, understanding this threat is important for systems that manage code repositories.

  • Unintended file writes and server access possible.
  • Affects systems managing code repositories.
  • Confirm relevance and exposure.

Attack Path

How an attacker could exploit the issue

An attacker can exploit this vulnerability by creating a malicious template repository. When this template is used to create a new repository, the vulnerability can be triggered, allowing the attacker to write to unintended files on the server, potentially leading to shell access.

  • Network access required, no privileges needed.
  • Template repository feature used for new repositories.
  • Unintended file writes, potential server shell access.

Live Threat

Current exploitation, exposure, and threat context

When supported by the advisory, attackers could write to unintended files on the server, potentially leading to unauthorized code execution or system compromise, due to improper handling of symlink destinations in template repositories.

  • Server files could be overwritten.
  • Unintended symlinks may be followed.
  • Attacker may gain server shell access.

Operational Fix

Recommended remediation, mitigation, and detection steps

Responsible teams likely include the application owners overseeing Forgejo, the infrastructure or platform teams managing its deployment, and potentially the network or security teams if the service is internet-facing. The first practical step is to identify all Forgejo instances, determine their exposure and business criticality, locate the accountable owner, and then prioritize remediation based on this risk assessment.

  • Application owners must own the issue.
  • Verify all Forgejo instances and exposure.
  • Plan remediation based on identified risk.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is Forgejo?

Forgejo is a self-hosted Git service used by organizations and individual developers to manage code repositories, host projects, and facilitate team collaboration. It functions as a web-based platform where users can push code, manage versions, and track development tasks. Because it serves as a central hub for source code, it is often deployed on server infrastructure to enable accessible collaboration across distributed developer teams.

What does CVE-2025-68937 mean for Forgejo security?

This vulnerability involves improper control of symbolic link resolution, classified as CWE-61. In plain terms, the software fails to correctly restrict where certain files are saved when processing template repositories. This flaw allows an attacker to bypass intended directory constraints, potentially writing data to unauthorized locations on the server, which can lead to gaining deeper control over the host system.

How is the CVE-2025-68937 vulnerability triggered?

The vulnerability is triggered when a user creates a new repository using a specifically crafted, malicious template repository. The system then incorrectly processes symlinks within that template, leading to the unauthorized file write. Simply using standard repositories or normal Git functions that do not involve these specific template operations does not initiate the flaw.

Why should I care about this Forgejo vulnerability?

According to Halo Surface Signal, Forgejo is typically deployed as a web application for developer collaboration, making its interface frequently accessible via the public internet or broad corporate networks. If your instance is reachable in this way, it increases the likelihood of unauthorized interaction. Organizations hosting code should treat this as a high priority given the potential for full server compromise.

What are the first steps to secure my Forgejo instance?

Begin by auditing your environment to locate all active Forgejo installations. Determine which versions are currently in use and verify their network accessibility. If you are running affected versions—specifically those before 13.0.2 or 11.0.7 for the LTS branch—prioritize updating the software to the patched release provided by the vendor to eliminate the underlying file handling risk.

References