CVE-2026-58511: Gitea Webhook Authorization Header Returned Vulnerability
LOWCVE-2026-58511 is a LOW (CVSS 2.7) webhook authorization header returned vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Gitea libraries in the Go ecosystem. The issue involves webhook authorization header returned in plaintext via api. Remediation is available by upgrading affected packages to version 1.27.0.
CVE-2026-58511 at a Glance
Security Impact
CVSS: 2.7
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:U/C:L/I:N/A:N).
How to Fix CVE-2026-58511
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.
Upgrade code.gitea.io/gitea to 1.27.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for code.gitea.io/gitea
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-58511, inspect your project dependencies for Gitea:
inspect dependencies for code.gitea.io/gitea
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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. 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
CVE-2026-58511 Affected Gitea Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
code.gitea.io/gitea
|
Go |
< 1.27.0
|
1.27.0
|
References
Frequently Asked Questions
What is CVE-2026-58511?
Which Gitea versions are affected?
What version fixes CVE-2026-58511?
Is code.gitea.io/gitea affected?
What is the CVSS score of CVE-2026-58511?
What CWE is associated with CVE-2026-58511?
How can I check Go dependencies for CVE-2026-58511?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3r5c-2xxx-h872",
"modified" : "2026-07-21T21:52:49Z",
"published" : "2026-07-21T21:52:49Z",
"aliases" : [ "CVE-2026-58511" ],
"summary" : "Gitea: Webhook Authorization Header Returned in Plaintext via API",
"details" : "## Summary\n\nThe `ToHook()` function in `services/webhook/general.go` decrypts the webhook's `HeaderAuthorizationEncrypted` field and returns the plaintext authorization header in the API response. Any repository admin can read the full plaintext value of webhook authorization headers (Bearer tokens, Basic auth credentials, API keys) set by other admins.\n\nThe authorization header is stored encrypted in the database using the server's `SecretKey`, but `ToHook()` decrypts it before serializing it into the API response — converting a write-only secret into a readable credential.\n\n## Vulnerable Code\n\n**File:** `services/webhook/general.go:407-420`\n\n```go\nfunc ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {\n // ...\n authorizationHeader, err := w.HeaderAuthorization() // DECRYPTS from DB\n if err != nil {\n return nil, err\n }\n return &api.Hook{\n // ...\n AuthorizationHeader: authorizationHeader, // PLAINTEXT in response\n // ...\n }, nil\n}\n```\n\n**Decryption function:** `models/webhook/webhook.go:209-216`\n\n```go\nfunc (w Webhook) HeaderAuthorization() (string, error) {\n if w.HeaderAuthorizationEncrypted == \"\" {\n return \"\", nil\n }\n return secret.DecryptSecret(setting.SecretKey, w.HeaderAuthorizationEncrypted)\n}\n```\n\n## Affected Endpoints\n\nAll call `ToHook()`:\n- `GET /api/v1/repos/{owner}/{repo}/hooks` (requires repo admin)\n- `GET /api/v1/repos/{owner}/{repo}/hooks/{id}` (requires repo admin)\n- `GET /api/v1/admin/hooks` (requires site admin)\n- `GET /api/v1/orgs/{org}/hooks` (requires org admin)\n- `GET /api/v1/user/hooks` (requires authenticated user)\n\n## Steps to Reproduce\n\n1. Admin A creates a webhook with a sensitive authorization header.\n2. Admin B (different repo admin) lists webhooks via `GET /api/v1/repos/{owner}/{repo}/hooks`.\n3. The API response includes the full plaintext authorization header set by Admin A.\n\n## Impact\n\n- Cross-admin secret exposure on shared repositories\n- Credential harvesting if a repo admin's Gitea token is stolen\n- External service compromise via leaked Bearer tokens and API keys\n- Undermines the intentional encryption-at-rest protection\n\n## Suggested Fix\n\nThe authorization header should be write-only. Return a masked/redacted version or a boolean `has_authorization_header` flag instead.\n\n## References\n\n- Vulnerable function: `services/webhook/general.go:392-425`\n- Decryption function: `models/webhook/webhook.go:209-216`\n- Verified against commit 19f0169",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "code.gitea.io/gitea"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.27.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/go-gitea/gitea/security/advisories/GHSA-3r5c-2xxx-h872"
}, {
"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-200" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-21T21:52:49Z",
"nvd_published_at" : null
}
}