Skip to content
SSRF Disclosed report Intermediate CVE-2022-0870

SSRF in repository migration

Gogs allowed users to specify internal network addresses as repository migration targets, enabling server-side request forgery. An attacker could use this to discover services on the internal network.

gogs/gogs

Originally disclosed on huntr

Gogs is a self-hosted Git service. The malicious user is able to discover services in the internal network through repository migration functionality. All installations accepting public traffic are affected. Internal network CIDRs are prohibited to be used as repository migration targets. Users should upgrade to 0.12.5 or the latest 0.13.0+dev. Gogs should be ran in its own private network until users can update.

From the GitHub Advisory Database (GHSA-7v5r-r995-q2x2, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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

How it worked

Root cause

Likely the repository migration feature did not validate or restrict the destination URL, allowing requests to internal network CIDRs.

Impact

An attacker could discover services in the internal network; all installations accepting public traffic are affected.

What the attacker needed

A Gogs account; repository migration feature enabled

The fix

The issue was fixed in version 0.12.5 and later 0.13.0+dev by prohibiting internal network CIDRs as migration targets; until upgrading, run Gogs in its own private network.

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 report has not been written yet. The Original tab links to the source.

This is a server-side request forgery (SSRF) bug. The application lets a user tell the server to fetch a repository from a URL, but it did not block internal network addresses, so an attacker could make the server connect to private services and learn what is running there.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More from gogs/gogs

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.