Kestrel
대시보드로 돌아가기
CVE-2026-58511LOW· 2.7GHSA대응게시일: 2026. 07. 21.수정일: 2026. 07. 21.

Gitea: Webhook Authorization Header Returned in Plaintext via API

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
2.7low

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한높음
사용자 상호작용불필요
범위불변
영향
기밀성 영향낮음
무결성 영향없음
가용성 영향없음
버전별 점수
CVSS 3.12.7LOW
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N

상세 설명

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

text
1func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {
2 // ...
3 authorizationHeader, err := w.HeaderAuthorization() // DECRYPTS from DB
4 if err != nil {
5 return nil, err
6 }
7 return &api.Hook{
8 // ...
9 AuthorizationHeader: authorizationHeader, // PLAINTEXT in response
10 // ...
11 }, nil
12}

Decryption function: models/webhook/webhook.go:209-216

text
1func (w Webhook) HeaderAuthorization() (string, error) {
2 if w.HeaderAuthorizationEncrypted == "" {
3 return "", nil
4 }
5 return secret.DecryptSecret(setting.SecretKey, w.HeaderAuthorizationEncrypted)
6}

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

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.