PT-2026-20322 · Gogs · Gogs

Spingarbor

·

Published

2026-02-17

·

Updated

2026-03-03

·

CVE-2026-25232

CVSS v3.1

8.8

High

VectorAV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Gogs versions 0.13.4 and below
Description Gogs, an open-source self-hosted Git service, contains an access control bypass issue. Repository collaborators with Write permissions can delete protected branches, including the default branch, by sending a direct POST request. This bypasses the branch protection mechanism, enabling privilege escalation from Write to Admin level. The vulnerability exists in the DeleteBranchPost function within the internal/route/repo/branch.go file, specifically lines 110-155. The web interface deletion operation does not trigger Git Hooks, which correctly prevent protected branch deletion via SSH push. Attackers must have write permissions to the target repository and access to the Gogs web interface to exploit this issue. The vulnerable code lacks checks for protected and default branches, while the UI layer and Git Hooks correctly implement these checks. The vulnerable API endpoint is '/delete/*' and the vulnerable parameter is the branch name.
Recommendations Versions prior to 0.14.1 are affected. Update to version 0.14.1 or later to resolve this vulnerability.

Exploit

Fix

Incorrect Authorization

Weakness Enumeration

Related Identifiers

CVE-2026-25232
GHSA-2C6V-8R3V-GH6P
GO-2026-4498
SUSE-SU-2026:0757-1

Affected Products

Gogs