Loading advisory.
Loading advisory.
Gitea: Webhook Authorization Header Returned in Plaintext via API
The ToHook() function in services/webhook/general.go decrypts the webhook's HeaderAuthorizationEncrypted field and returns the plaintext authorization header in the API response.
Published 2026-07-21 21:52 UTC · Modified 2026-08-13 18:50 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| code.gitea.io/gitea | Go | < 1.27.0 | 1.27.0 | go get code.gitea.io/gitea@v1.27.0 |
| gitea.dev | Go | < 1.27.0 | 1.27.0 | go get gitea.dev@v1.27.0 |
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.
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)
}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)
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.
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
The authorization header should be write-only. Return a masked/redacted version or a boolean has_authorization_header flag instead.
Vulnerable function: services/webhook/general.go:392-425
Decryption function: models/webhook/webhook.go:209-216
Verified against commit 19f0169
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.004 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |