Gitea
CVE-2026-58511
LOW
Severity by source
AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N
Requires repo admin authentication (PR:H) over network (AV:N); only webhook authorization header values disclosed, not broader system secrets (C:L).
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N
Lifecycle Timeline
2DescriptionGitHub Advisory
Summary
The 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.
The 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.
Vulnerable Code
File: services/webhook/general.go:407-420
func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {
// ...
authorizationHeader, err := w.HeaderAuthorization() // DECRYPTS from DB
if err != nil {
return nil, err
}
return &api.Hook{
// ...
AuthorizationHeader: authorizationHeader, // PLAINTEXT in response
// ...
}, nil
}Decryption function: models/webhook/webhook.go:209-216
func (w Webhook) HeaderAuthorization() (string, error) {
if w.HeaderAuthorizationEncrypted == "" {
return "", nil
}
return secret.DecryptSecret(setting.SecretKey, w.HeaderAuthorizationEncrypted)
}Affected Endpoints
All call ToHook():
GET /api/v1/repos/{owner}/{repo}/hooks(requires repo admin)GET /api/v1/repos/{owner}/{repo}/hooks/{id}(requires repo admin)GET /api/v1/admin/hooks(requires site admin)GET /api/v1/orgs/{org}/hooks(requires org admin)GET /api/v1/user/hooks(requires authenticated user)
Steps to Reproduce
- Admin A creates a webhook with a sensitive authorization header.
- Admin B (different repo admin) lists webhooks via
GET /api/v1/repos/{owner}/{repo}/hooks. - The API response includes the full plaintext authorization header set by Admin A.
Impact
- Cross-admin secret exposure on shared repositories
- Credential harvesting if a repo admin's Gitea token is stolen
- External service compromise via leaked Bearer tokens and API keys
- Undermines the intentional encryption-at-rest protection
Suggested Fix
The authorization header should be write-only. Return a masked/redacted version or a boolean has_authorization_header flag instead.
References
- Vulnerable function:
services/webhook/general.go:392-425 - Decryption function:
models/webhook/webhook.go:209-216 - Verified against commit 19f0169
AnalysisAI
Webhook authorization headers in Gitea are decrypted and returned as plaintext in API responses, exposing Bearer tokens, Basic auth credentials, and API keys to any repository admin who queries the webhook listing endpoints. All Gitea installations running versions prior to 1.27.0 are affected, confirmed by GitHub Advisory GHSA-3r5c-2xxx-h872 and verified against commit 19f0169. …
Unlock full vulnerability intelligence
- Risk assessment & exploitation conditions
- Attack chain visualization
- Remediation with exact patch versions
- Threat intelligence from 22 sources
- Personal watchlist & email alerts
Free forever · No credit card required
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata
Vulnerability AssessmentAI
| Exploitation | Exploitation requires an authenticated Gitea session with at minimum repository admin privileges on the target repository - a non-admin authenticated user cannot access webhook listing endpoints. … Additional conditions and limiting factors are described in the full assessment. |
| Risk Assessment | The CVSS 3.1 score of 2.7 Low is driven primarily by the high privilege requirement (PR:H), which correctly reflects that exploitation demands an authenticated repository admin session. … Full risk analysis with EPSS, KEV, and SSVC signal comparison available after sign-in. |
| Exploit Scenario | An authenticated Gitea repository admin issues a standard GET /api/v1/repos/{owner}/{repo}/hooks request using their own valid session token. The API response includes the full plaintext Bearer token or API key that a different admin had configured on a webhook to authenticate deliveries to an external CI/CD system. … |
| Remediation | Upgrade Gitea to version 1.27.0 or later, which contains the vendor-released patch referenced at https://github.com/go-gitea/gitea/releases/tag/v1.27.0. … Detailed patch versions, workarounds, and compensating controls in full report. |
Threat intelligence, references, and detailed analysis are available after sign-in.
Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r
Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp
The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir
Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea
Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec
models/repo_mirror.go in Gitea before 1.7.6 and 1.8.x before 1.8-RC3 mishandles mirror repo URL settings, leading to rem
An issue was discovered in Gitea through 1.11.5. Rated high severity (CVSS 7.5), this vulnerability is remotely exploita
Missing Authorization in GitHub repository go-gitea/gitea prior to 1.16.4. Rated high severity (CVSS 7.1), this vulnerab
Open Redirect on login in GitHub repository go-gitea/gitea prior to 1.16.5. Rated medium severity (CVSS 6.1), this vulne
Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any
Branch-protection bypass in Gitea's self-hosted Git server (all versions before 1.26.0) allows a user with push access t
Migration transport protections in Gitea are bypassed for Git LFS operations, affecting all self-hosted instances before
Same weakness CWE-200 – Information Exposure
View allSame technique Information Disclosure
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-3r5c-2xxx-h872