Skip to content
Path traversal Write-up Intermediate

Gogs PutContents API Sembolik Bağlantı İstismarı (CVE-2025–

Gogs's PutContents API checked whether a path stayed inside the repository using a call that follows symbolic links, so a symlink committed into a repo could point outside it. An authenticated attacker could then write attacker-chosen content to files such as the repository's own Git config and turn that into command execution on the server.

Erdem Ceylan Follow

Published on medium.com

Modern yazılım geliştirme ekosistemlerinde Git servisleri, kurumsal fikri mülkiyetin ve operasyonel sürekliliğin kalbi konumundadır. Bu bağlamda, Go dilinde geliştirilen ve hafif mimarisiyle bilinen Gogs (Go Git Service) platformunda tespit edilen CVE-2025–8110 zafiyeti, yalnızca teknik bir hata değil, aynı zamanda…

Erdem Ceylan, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the path validation used os.Stat(), which resolves symbolic links, so a symlink inside the repository passed the containment check while the actual write followed it to a target outside the repository.

Impact

An authenticated attacker could run arbitrary commands with the Gogs service user's privileges, and the text reports an active campaign that compromised roughly 700 internet-facing instances.

What the attacker needed

A valid account (open registration helps); ability to create a repository; a Git operation on the server to trigger

The fix

It was fixed in version 0.13.4, which rejects file paths containing symbolic links at the API level.

How it was found

  1. Create or take over a valid account on the Gogs instance and create a new repository.
  2. Commit a symbolic link into the repository that points at a sensitive file outside the repository.
  3. Send a PUT request to the PutContents API using the symlink's path as the target path, with the desired content in the body.
  4. Trigger a Git operation so the injected configuration runs the attacker's command on the server.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A symbolic link is a shortcut file that points at another file, and programs usually follow it without asking. Gogs checked the shortcut's location inside the repository but not where the shortcut led, so a write landed on a file outside the repository. Because that file controls how Git runs commands, the attacker could get their own commands run on the server.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Erdem Ceylan

View all

7 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.