Gitea · Gitea · CVE-2026-58511
**Name of the Vulnerable Software and Affected Versions**
Gitea (affected versions not specified)
**Description**
The `ToHook()` function in `services/webhook/general.go` decrypts the `HeaderAuthorizationEncrypted` field and returns the plaintext authorization header in the API response. This allows repository administrators to read sensitive credentials, such as Bearer tokens, Basic auth credentials, and API keys, set by other administrators. The issue occurs because the function decrypts the secret stored in the database using the server's `SecretKey` before serializing it into the response, effectively converting a write-only secret into a readable credential.
**API Endpoints:**
- '/api/v1/repos/{owner}/{repo}/hooks'
- '/api/v1/repos/{owner}/{repo}/hooks/{id}'
- '/api/v1/admin/hooks'
- '/api/v1/orgs/{org}/hooks'
- '/api/v1/user/hooks'
**Vulnerable Parameters or Variables:**
- `HeaderAuthorizationEncrypted`
**Function Names:**
- `ToHook()`
- `HeaderAuthorization()`
**Recommendations**
At the moment, there is no information about a newer version that contains a fix for this vulnerability.
As a temporary workaround, restrict access to the affected API endpoints to minimize the risk of credential exposure.