Skip to content

DeleteLabel compares one untyped id against whichever namespace the label uses, letting a repo collaborator delete an ID-colliding organisation's labels

Low
bircni published GHSA-fxq4-gr55-7x5g Oct 18, 2026

Package

gomod gitea.dev (Go)

Affected versions

<= 28.1.0

Patched versions

28.2.0

Description

Summary

DeleteLabel(ctx, id, labelID) takes one untyped id and compares it against the
label's org id or its repo id, depending on what kind of label it turns out to be.
Repository ids and organisation ids come from independent sequences and collide freely.
A user with issues-write on repository id N can therefore delete labels belonging to
organisation id N, a tenant they have no standing in.

Details

// models/issues/label.go:273-302 (v1.27.3)
func DeleteLabel(ctx context.Context, id, labelID int64) error {
	l, err := GetLabelByID(ctx, labelID)
	…
	return db.WithTx(ctx, func(ctx context.Context) error {
		if l.BelongsToOrg() && l.OrgID != id {
			return nil
		}
		if l.BelongsToRepo() && l.RepoID != id {
			return nil
		}

		if _, err = db.DeleteByID[Label](ctx, labelID); err != nil {
			…

Which test runs is chosen by the label's kind, not the caller's. The repo-scoped
handler passes ctx.Repo.Repository.ID; if labelID resolves to an org label, the
first branch compares that repository id against the label's organisation id. Equal
numbers pass the check and the delete goes ahead.

Callers: routers/api/v1/repo/label.go:271, routers/api/v1/org/label.go:252,
routers/web/repo/issue_label.go:157, routers/web/org/org_labels.go:88. The org-side
routes require reqOrgOwnership; the repo-side ones do not.

Impact

This deletes one tenant's labels from inside another tenant. Labels carry triage state,
so removing an organisation's labels detaches them from every issue in that org that
used them. The collision is not attacker-chosen. My run arranges one deliberately with
filler repositories on an empty instance; on a populated instance, forcing a specific
collision may well be impractical, though spotting an existing one is cheap since both
ids are visible through the API. I scored AC:H for that, and I have shown the missing
type check rather than a practical targeted attack.

CVE-2026-58445 (GHSA-pgqf-926r-548m) and CVE-2026-25038 fixed label scoping at or
below 1.27.0; this conflation survives both.

AI usage

I noticed DeleteLabel scopes on a single untyped id, read that function and its four
callers at v1.27.3, then ran the colliding-id fixture against both routes on a private
instance; the PoC block is its stdout. An LLM helped with the prose.

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N

CVE ID

CVE-2026-97204

Weaknesses

Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. Learn more on MITRE.

Credits