CVE-2026-58440: Gitea Webhooks Created By A Collaborator Vulnerability

MODERATE
Advisory Identifier: GHSA-66m4-5jjr-2rg5
CVSS 6.8
CWE-863
Published
Advisory Summary

CVE-2026-58440 is a MODERATE (CVSS 6.8) webhooks created by a collaborator vulnerability (CWE-863: Incorrect Authorization) affecting Gitea libraries in the Go ecosystem. The issue involves webhooks created by a collaborator keep firing after their repo access is revoked → ongoing real-time exfiltration of private repo content. Remediation is available by upgrading affected packages to version 1.27.0.

CVE-2026-58440 at a Glance

CVE Identifier CVE-2026-58440
GHSA Identifier GHSA-66m4-5jjr-2rg5
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-863: Incorrect Authorization
Affected Product Gitea
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-58440

To remediate this vulnerability, upgrade all affected Gitea dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gitea.dev fixed: 1.27.0
Upgrade gitea.dev to 1.27.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gitea.dev

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-58440, inspect your project dependencies for Gitea:

inspect dependencies for gitea.dev

Analyze the terminal output to locate any version of Gitea in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.27.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where 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. In Gitea, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Affected product Gitea — `services/repository/collaboration.go` (`DeleteCollaboration`) + webhook delivery ## Summary When a collaborator with admin permission on a private repo creates a webhook, that webhook keeps firing after the collaborator's access is revoked. Gitea's revocation cleanup `DeleteCollaboration` removes the collaboration record, recalculates accesses, drops watches, and unassigns issues — but it does **not** remove or disable webhooks the user created, and webhook delivery never re-checks whether the creator still has repo access. The former collaborator therefore receives the full payload (issue/comment bodies, commit data) of all future repository events at their controlled endpoint, indefinitely and invisibly. ## Affected code - `services/repository/collaboration.go` → `DeleteCollaboration()` — cleans watches/assignees only; no webhook cleanup. - Webhook delivery path — fires on repo events without re-validating the creator's current access. ## Steps to reproduce Using the provided reproduction materials: 1. Attacker (admin collaborator) creates a webhook → revoke access. 2. Control: `GET /api/v1/repos/admin/wh-repo` (attacker) → **404**. 3. `GET .../hooks` → webhook still `active=true`. 4. Admin creates a new issue **after** revocation → the catcher receives `action:"opened"`, `issue.title:"CRITICAL SECRET: …"`, `issue.body` (sentinel private key), `repository.private:true`. (Runtime-confirmed on `gitea/gitea:1.25.4`. Catcher is an internal sentinel listener; the payload is a planted sentinel, not real data; nothing is sent to any external/metadata endpoint.) ## Impact Authenticated former admin-collaborator → ongoing real-time exfiltration of private content created after revocation; invisible to the owner; scope crosses from the application boundary to data the user should no longer access. ## Suggested remediation 1. On revocation, delete/disable webhooks created by the removed collaborator (or hand them to the owner). 2. Re-validate the creator's current repo access before each webhook delivery. 3. At minimum, warn admins on revocation if the user created webhooks. ## Credit Reported as part of an incomplete-patch / authorization-residue measurement study (responsible disclosure).

CVE-2026-58440 Affected Gitea Versions

1 component(s)
Fixed Versions:
1.27.0
Product / Package Ecosystem Affected Versions Fixed Version
gitea.dev
Go
< 1.27.0
1.27.0

References

Frequently Asked Questions

What is CVE-2026-58440?
CVE-2026-58440 is a security vulnerability in Gitea involving Webhooks created by a collaborator keep firing after their repo access is revoked → ongoing real-time exfiltration of private repo content under CWE-863: Incorrect Authorization.
Which Gitea versions are affected?
Affected versions include releases prior to 1.27.0 across affected packages: gitea.dev.
What version fixes CVE-2026-58440?
Upgrading to 1.27.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gitea.dev affected?
Yes, gitea.dev is affected in releases prior to 1.27.0. Upgrade your dependency to 1.27.0 or later.
What is the CVSS score of CVE-2026-58440?
CVE-2026-58440 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-58440?
CVE-2026-58440 is classified under CWE-863: 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.).
How can I check Go dependencies for CVE-2026-58440?
Run the dependency tree command: 'inspect dependencies for gitea.dev'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-66m4-5jjr-2rg5",
  "modified" : "2026-07-21T20:11:36Z",
  "published" : "2026-07-21T20:11:36Z",
  "aliases" : [ "CVE-2026-58440" ],
  "summary" : "Gitea: Webhooks created by a collaborator keep firing after their repo access is revoked → ongoing real-time exfiltration of private repo content",
  "details" : "## Affected product\nGitea — `services/repository/collaboration.go` (`DeleteCollaboration`) + webhook delivery\n\n## Summary\nWhen a collaborator with admin permission on a private repo creates a webhook, that webhook keeps firing\nafter the collaborator's access is revoked. Gitea's revocation cleanup `DeleteCollaboration` removes the\ncollaboration record, recalculates accesses, drops watches, and unassigns issues — but it does **not**\nremove or disable webhooks the user created, and webhook delivery never re-checks whether the creator still\nhas repo access. The former collaborator therefore receives the full payload (issue/comment bodies, commit\ndata) of all future repository events at their controlled endpoint, indefinitely and invisibly.\n\n## Affected code\n- `services/repository/collaboration.go` → `DeleteCollaboration()` — cleans watches/assignees only; no\n  webhook cleanup.\n- Webhook delivery path — fires on repo events without re-validating the creator's current access.\n\n## Steps to reproduce\nUsing the provided reproduction materials:\n1. Attacker (admin collaborator) creates a webhook → revoke access.\n2. Control: `GET /api/v1/repos/admin/wh-repo` (attacker) → **404**.\n3. `GET .../hooks` → webhook still `active=true`.\n4. Admin creates a new issue **after** revocation → the catcher receives `action:\"opened\"`,\n   `issue.title:\"CRITICAL SECRET: …\"`, `issue.body` (sentinel private key), `repository.private:true`.\n(Runtime-confirmed on `gitea/gitea:1.25.4`. Catcher is an internal sentinel listener; the payload is a\nplanted sentinel, not real data; nothing is sent to any external/metadata endpoint.)\n\n## Impact\nAuthenticated former admin-collaborator → ongoing real-time exfiltration of private content created after\nrevocation; invisible to the owner; scope crosses from the application boundary to data the user should no\nlonger access.\n\n## Suggested remediation\n1. On revocation, delete/disable webhooks created by the removed collaborator (or hand them to the owner).\n2. Re-validate the creator's current repo access before each webhook delivery.\n3. At minimum, warn admins on revocation if the user created webhooks.\n\n## Credit\nReported as part of an incomplete-patch / authorization-residue measurement study (responsible disclosure).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gitea.dev"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.27.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/security/advisories/GHSA-66m4-5jjr-2rg5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/pull/38406"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/pull/38426"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/commit/de4b8277e9cb576f2315fb03b5ab6478b42a1d31"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/commit/f69e15afe7496cc62e96dab244629c69eb31a7bf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-gitea/gitea"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/releases/tag/v1.27.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-21T20:11:36Z",
    "nvd_published_at" : null
  }
}