2.7low
Webhook Authorization Header Returned in Plaintext via API
- Severity
- 2.7low CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.24% (higher than 16% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Gitea
- Also known as
- GHSA-3r5c-2xxx-h872GO-2026-6040
Description
Webhook Authorization Header Returned in Plaintext via API
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Gitea Gitea Open Source Git Server | up to 1.26.4 | CVE List |
| code.gitea.io/gitea (Go) | before 1.27.0 | GitHub Advisory Database |
| gitea.dev (Go) | before 1.27.0 | Go Vulnerability Database |
All scores
| CISA-ADP | 2.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N |
| GitHub | 2.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Webhook Authorization Header Returned in Plaintext via API
GitHub Advisory Database
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
Go Vulnerability Database
Gitea: Webhook Authorization Header Returned in Plaintext via API in gitea.dev
References
| https://github.com/go-gitea/gitea/security/advisories/GHSA-3r5c-2xxx-h872 | advisory, exploit, vendor-advisory, web | |
| https://github.com/go-gitea/gitea/releases/tag/v1.27.0 | release-notes, web | |
| https://blog.gitea.com/gitea-1.27.0-is-released/ | release-notes | |
| https://github.com/go-gitea/gitea | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-58511 changed 2026-08-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3r5c-2xxx-h872 changed 2026-07-22 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-6040 changed 2026-07-22 | CC-BY-4.0 |
| NVD | CVE-2026-58511 changed 2026-08-26 | Public domain |