# CVE-2025-68937: Path traversal in Forgejo

> Attackers can write to unintended files and potentially gain server shell access via mishandled symlink destinations in template repositories.

- **Severity:** Critical 9.5 (`CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 25 Dec 2025
- **Updated:** 26 Dec 2025
- **Also known as:** GHSA-7mhf-6fhv-c83c

## What is CVE-2025-68937?

CVE-2025-68937 is a critical path traversal vulnerability in Forgejo, published on 25 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Forgejo before 13.0.2 allows attackers to write to unintended files, and possibly obtain server shell access, because of mishandling of out-of-repository symlink destinations for template repositories. This is also fixed for 11 LTS in 11.0.7 and later.

Weakness: CWE-61 (UNIX Symbolic Link (Symlink) Following)

## Which versions are affected by CVE-2025-68937?


## How do I fix CVE-2025-68937?

No fix has been published for CVE-2025-68937 yet. Limit exposure of the affected software until one is available.

## Is CVE-2025-68937 being exploited?

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

Public exploit code:

- Directory traversal in Gitea and Forgejo's repository‑template processing allows remote authenticated attackers to process arbitrary files on the filesystem, leading to remote code execution. (github_poc): https://github.com/ClemaX/Gitea-Forgejo-CVE-2025-68937
- Automated PoC exploit for CVE-2025-68937 — Gitea/Forgejo Template Symlink RCE. Any authenticated user can get a shell as the git service user. (github_poc): https://github.com/Scratchappy/CVE-2025-68937

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68937 and fix it if it is affected.

What it is: CVE-2025-68937 is a critical path traversal vulnerability in Forgejo, published on 25 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-68937 in the wild and no public exploit code.

Affected product: Forgejo. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-68937/ (Markdown: https://insights.sbomify.com/CVE-2025-68937/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-68937
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-68937
- OSV: https://osv.dev/vulnerability/CVE-2025-68937

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-68937/
Summaries are generated and may contain mistakes; the official description above is the record.
