Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain admin collaborator grant on target repository
-
DeliveryAuthenticate to Gogs web interface
-
ExploitPOST mode=4 to collaboration access_mode route
-
ExecutionOff-by-one check passes mode=4 as valid
-
PersistDatabase persists owner-level access in access table
-
ImpactExecute owner-only operations (delete repository or transfer ownership)
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Off-by-one prevention
|
| Exploitation Conditions | Exploitation requires the attacker to already hold admin collaborator access (AccessModeAdmin=3) explicitly granted by the repository owner - Gogs installations with no admin-level collaborators are not at risk from this vulnerability. The attacker must be authenticated to the Gogs instance and must use the web interface route ( |
| Impact | No NVD CVSS score is available at time of analysis; my independently assessed score of CVSS 3.1 8.8 (High) reflects network exploitability with a low-privilege prerequisite. The critical limiting factor is that exploitation requires the attacker to already hold an explicitly granted admin collaborator role on the target repository - it is not a zero-privilege or unauthenticated attack. However, once that prerequisite is satisfied, exploitation is mechanically trivial: a single crafted HTTP POST with |
| Exploit ScenarioDerived | An attacker who has been legitimately granted admin collaborator access (mode=3) to a private Gogs repository authenticates to the instance and sends a single crafted HTTP POST to |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 23, 2026
Privilege escalation in Gogs versions prior to 0.14.3 allows repository admin collaborators to elevate their own access to owner-level by exploiting an off-by-one boundary check in the ChangeCollaborationAccessMode function. The web route accepts a raw integer mode query parameter, and the faulty guard mode > AccessModeOwner evaluates to false when mode equals 4, letting an admin (mode=3) POST mode=4 to silently receive full owner privileges - including the ability to delete the repository, transfer ownership, and erase wiki data. No public exploit identified at time of analysis, though the advisory includes complete reproduction steps that function as a de facto proof of concept.
RemediationAI
Upgrade Gogs to version 0.14.3 or later, which resolves the issue via commit 1fdc9cc28e159135cfa4d6b11ecd5daa0f8ce22b and PR #8227 (https://github.com/gogs/gogs/pull/8227). The patch corrects the validation bound from AccessModeOwner to AccessModeAdmin and introduces actor-bound enforcement so no collaborator can grant a privilege level exceeding their own. If immediate upgrade is not possible, administrators should audit the collaboration and access database tables for any rows where mode=4 is set for non-owner user accounts, which would indicate prior exploitation; any such rows should be corrected manually. As a compensating control, restrict or remove admin-level collaborator grants to only the most trusted users, since exploitation requires holding that role. Blocking the web route /{owner}/{repo}/settings/collaboration/access_mode at the network perimeter or reverse proxy is a high-friction but effective mitigation with the trade-off of disabling the collaboration management UI entirely. The API endpoint requires no mitigation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Gogs is a self-hosted Git service written in Go (CPE: pkg:go/gogs.io/gogs). The root cause is CWE-193 (Off-by-One Error) in internal/database/repo_collaboration.go. The access mode enumeration is an integer sequence: AccessModeNone=0, AccessModeRead=1, AccessModeWrite=2, AccessModeAdmin=3, AccessModeOwner=4. The validation guard mode > AccessModeOwner was intended to reject the owner value (4) but uses strict greater-than instead of greater-than-or-equal, so the check 4 > 4 evaluates to false and the value passes. The web route handler in internal/route/repo/setting.go deserializes the mode directly from the URL query string as a raw integer with no further sanitization, making the attack a single crafted POST. The API route is unaffected because it routes through ParseAccessMode(), which maps string labels to only Read, Write, or Admin - never Owner. The fix in v0.14.3 (PR #8227, commit 1fdc9cc) corrects the bound to mode > AccessModeAdmin and adds an actor-bound parameter so no actor can grant a level exceeding their own.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:P
Network-exploitable via HTTP POST with PR:L because an existing admin collaborator role is required; high C/I/A because owner access enables full repository deletion and data destruction.
Primary rating from Vendor (https://github.com/gogs/gogs).
CVSS VectorVendor: https://github.com/gogs/gogs
Lifecycle Timeline
1DescriptionCVE.org
Summary
A repository admin collaborator can escalate their privileges to owner-level access by exploiting an off-by-one error in the ChangeCollaborationAccessMode function.
Vulnerable Code
In internal/database/repo_collaboration.go, line 129:
func (r *Repository) ChangeCollaborationAccessMode(userID int64, mode AccessMode) error {
// Discard invalid input
if mode <= AccessModeNone || mode > AccessModeOwner {
return nil
}AccessModeOwner has value 4. The check mode > AccessModeOwner evaluates to 4 > 4 = false, allowing AccessModeOwner to pass through. The correct check should be mode >= AccessModeOwner.
The web route at internal/route/repo/setting.go:413-416 takes the mode as a raw integer from query parameters:
func ChangeCollaborationAccessMode(c *context.Context) {
if err := c.Repo.Repository.ChangeCollaborationAccessMode(
c.QueryInt64("uid"),
database.AccessMode(c.QueryInt("mode"))); err != nil {This allows an admin collaborator to POST mode=4 and escalate to owner.
Impact
A repository admin collaborator (AccessModeAdmin = 3) can escalate to owner-level access (AccessModeOwner = 4), gaining the ability to:
- Delete the repository
- Transfer repository ownership to another user
- Erase wiki data
- Perform all other owner-only operations
The access table is also updated (line 181), so the escalated permissions persist across sessions.
Contrast
The API route at internal/route/api/v1/repo_collaborators.go:46 uses ParseAccessMode() which only returns Read, Write, or Admin - never Owner. The API endpoint is not affected.
Steps to Reproduce
- User A creates a private repository
- User A adds User B as a collaborator with Admin access (mode=3)
- User B logs in and navigates to the repository settings collaboration page
- User B sends a POST request:
POST /{owner}/{repo}/settings/collaboration/access_mode?uid={B_uid}&mode=4- User B now has Owner access - the "Danger Zone" section appears with "Delete This Repository" and "Transfer Ownership" buttons
Suggested Fix
Change the validation in internal/database/repo_collaboration.go line 129 from:
if mode <= AccessModeNone || mode > AccessModeOwner {to:
if mode <= AccessModeNone || mode >= AccessModeOwner {Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Same weakness CWE-193 – Off-by-one Error
View allSame technique Privilege Escalation
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-39072
GHSA-4565-r4x7-hg8j
NVD
CVE.org
EPSS
VulDB
Exploit-DB