{"id":"CVE-2026-58445","aliases":["CVE-2026-58445","GHSA-pgqf-926r-548m","GO-2026-6067"],"related":[],"kind":"vulnerability","state":"published","title":"Cross-repository label-ID enumeration oracle via unscoped DeleteIssueLabel API","summary":"Cross-repository label-ID enumeration oracle via unscoped DeleteIssueLabel API","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Cross-repository label-ID enumeration oracle via unscoped DeleteIssueLabel API","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe API endpoint `DELETE /repos/{owner}/{repo}/issues/{index}/labels/{id}` loads the label by ID with a **global,\nunscoped** lookup and never verifies the label belongs to the URL's repository (or its owning organization). Because\nthe response status differs by whether the label ID exists **anywhere on the instance** (204) versus not (422), an\nauthenticated user can use the endpoint as a **cross-repository label-ID existence / enumeration oracle**, including\nfor labels in repositories and organizations they cannot access.\n\n## Severity\n\n- The leaked information is minimal (existence/count of label IDs instance-wide); **no label name, color, or owning\n  repository is disclosed, and no cross-repository write occurs.**\n\n## Affected / patched versions\n\n- **Affected:** through **1.26.3** (latest at time of report).\n- **Patched:** none yet.\n\n## Details\n\n`DeleteIssueLabel` resolves the label with a global loader and never checks its scope:\n\n```go\n// routers/api/v1/repo/issue_label.go  (DeleteIssueLabel)\nlabel, err := issues_model.GetLabelByID(ctx, ctx.PathParamInt64(\"id\"))   // global, unscoped\n```\n\n`GetLabelByID` (`models/issues/label.go`) is `e.ID(labelID).Get(l)` with **no** `repo_id` / `org_id` filter. The\nhandler never verifies `label.RepoID == ctx.Repo.Repository.ID` (nor the org-label equivalent), and the downstream\n`issue_service.RemoveLabel` (`services/issue/label.go`) only re-checks the doer's write permission on the **issue's\nown** repository — never that the label belongs to it.\n\nEvery sibling label handler is correctly scoped — `GetLabel` / `EditLabel` / `DeleteLabel` (repo and org) use\n`GetLabelInRepoByID` / `GetLabelInOrgByID` and return 404 for a foreign ID. `DeleteIssueLabel` is the only outlier.\n\n**Why it is only an oracle:** `deleteIssueLabel` (`models/issues/issue_label.go`) deletes the `issue_label` row keyed\nby `(issue.ID, label.ID)`. For a foreign label, no such row exists → the function returns early **before** any\nmutation or comment creation. So there is no cross-repo write and no leak of the label's name. But the HTTP status\ndiffers:\n\n- label ID exists anywhere on the instance (incl. private repos/orgs) → **204 No Content**\n- label ID does not exist → **422** (`ErrLabelNotExist`)\n\nLabel IDs are sequential auto-increment, so this enumerates the instance-wide label population and probes existence\nof specific IDs across tenant boundaries.\n\n## Proof of Concept\n\nVerified end-to-end on a build of the `v1.26.3` tag.\n\n- `alice` (private repo `alice/secret`) creates a label → internal id **1**.\n- Attacker `bob` (separate user; public repo `bob/pub` with issue #1; **no access** to `alice/secret`) holds a token\n  with `write:issue` on his own repo.\n\n```text\nbob DELETE /api/v1/repos/bob/pub/issues/1/labels/1          -> HTTP 204   (alice's PRIVATE label id exists)\nbob DELETE /api/v1/repos/bob/pub/issues/1/labels/99999999   -> HTTP 422   (no such label)\n```\n\nDiffering only by the label ID: `204` vs `422` distinguishes \"label ID exists\" from \"does not exist.\" `bob` has zero rights to `alice/secret` but can still learn label id 1 exists. (Alice's label is untouched — no write.)\n\nReproduction steps:\n1. Create two users `alice`, `bob`. As `alice`, create a private repo and a label on it (note the label `id` from\n   the API response).\n2. As `bob`, create any repo with an issue, and a token with `write:issue`.\n3. `curl -u bob:$T -X DELETE https://<gitea>/api/v1/repos/bob/pub/issues/1/labels/<alice_label_id>` → **204**.\n4. `curl -u bob:$T -X DELETE https://<gitea>/api/v1/repos/bob/pub/issues/1/labels/99999999` → **422**.\n5. The differing status across an ID `bob` cannot otherwise see is the oracle.\n\n## Impact\n\nCross-tenant authorization-key bypass producing a label-ID existence/enumeration oracle: an authenticated user can\ndetermine whether arbitrary label IDs (including in private repositories and organizations they cannot access) exist,\nand enumerate the instance-wide label population.\n\n## Remediation\n\nScope the loader like every sibling handler, returning 404 for a label that is not in the URL repository (or its\nowning organization), so the status no longer distinguishes existence:\n\n```go\n// routers/api/v1/repo/issue_label.go — in DeleteIssueLabel, after loading the label\nif label.RepoID != ctx.Repo.Repository.ID && label.OrgID != ctx.Repo.Repository.OwnerID {\n    ctx.APIErrorNotFound()\n    return\n}\n```\n\n(Equivalently, resolve via `GetLabelInRepoByID` and, for org repositories, also accept the repo owner's org labels —\nmirroring the scoping in `GetLabel`/`EditLabel`/`DeleteLabel`.)","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gitea: Cross-repository label-ID enumeration oracle via unscoped DeleteIssueLabel API in gitea.dev","format":"markdown","source":"go"}],"published":"2026-07-21T20:39:22.000Z","modified":"2026-08-26T16:53:48.300Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","score":2.7,"rating":"LOW"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","score":2.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","score":2.7,"rating":"LOW"}],"cwes":["CWE-203","CWE-639"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"1.26.4","status":"affected"}],"vendor":"Gitea","product":"Gitea Open Source Git Server","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.27.0"}],"ecosystem":"Go","package":"code.gitea.io/gitea","purl":"pkg:golang/code.gitea.io/gitea","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.27.0"}],"ecosystem":"Go","package":"gitea.dev","purl":"pkg:golang/gitea.dev","source":"go"}],"references":[{"url":"https://github.com/go-gitea/gitea/security/advisories/GHSA-pgqf-926r-548m","tags":["advisory","exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-gitea/gitea/releases/tag/v1.27.0","tags":["release-notes","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://blog.gitea.com/gitea-1.27.0-is-released/","tags":["release-notes"],"sources":["cvelist","nvd"]},{"url":"https://github.com/go-gitea/gitea","tags":["package"],"sources":["ghsa"]}],"credits":["CassianStarck"],"assigner":"Gitea","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-08-14T19:07:25.742Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-58445","url":"https://www.cve.org/CVERecord?id=CVE-2026-58445","licence":"CVE Terms of Use","modified":"2026-08-14T19:08:41.522Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pgqf-926r-548m","url":"https://github.com/advisories/GHSA-pgqf-926r-548m","licence":"CC-BY-4.0","modified":"2026-07-27T17:11:14.742Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6067","url":"https://pkg.go.dev/vuln/GO-2026-6067","licence":"CC-BY-4.0","modified":"2026-07-27T17:00:24.606Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-58445","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-58445","licence":"Public domain","modified":"2026-08-26T16:53:48.300Z"}],"updatedAt":"2026-11-25T22:59:32.806Z","epss":{"score":0.00304,"percentile":0.2498,"date":"2026-12-02T12:00:21.000Z"}}