CVE-2026-58511
lowpriority · track · 0EPSS 0.004 · 32 %ileDEEURUUSEPSS · scored 2026-10-26
Webhook Authorization Header Returned in Plaintext via API
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (9)
Products and version ranges known to be affected.
advisories (3)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2026-2304Gitea: Mehrere SchwachstellenDeutsch2026-07-13csaf · cert_bundDE
Ein Angreifer kann mehrere Schwachstellen in Gitea ausnutzen, um beliebigen Programmcode auszuführen, erweiterte Berechtigungen zu erlangen, Sicherheitsmaßnahmen zu umgehen, Daten zu manipulieren, sensible Informationen offenzulegen, Sitzungen zu übernehmen oder wiederzuverwenden oder einen Denial-of-Service-Zustand auszulösen.
- GHSA-3r5c-2xxx-h872Gitea: Webhook Authorization Header Returned in Plaintext via API2026-07-21ghsa · osvUS
## 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` ```go 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` ```go 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 1. Admin A creates a webhook with a sensitive authorization header. 2. Admin B (different repo admin) lists webhooks via `GET /api/v1/repos/{owner}/{repo}/hooks`. 3. 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-2026-6040Gitea: Webhook Authorization Header Returned in Plaintext via API in gitea.dev2026-07-22vendor · osvUS
Gitea: Webhook Authorization Header Returned in Plaintext via API in gitea.dev
also known as (6)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (6)
External citations — patches, advisories, analysis.
- https://blog.gitea.com/gitea-1.27.0-is-released/enisa_euvd
- https://github.com/go-gitea/gitea/releases/tag/v1.27.0enisa_euvd
- https://github.com/go-gitea/gitea/security/advisories/GHSA-3r5c-2xxx-h872enisa_euvd
- https://blog.gitea.com/gitea-1.27.0-is-released/nvd
- https://github.com/go-gitea/gitea/releases/tag/v1.27.0nvd
- https://github.com/go-gitea/gitea/security/advisories/GHSA-3r5c-2xxx-h872nvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan