Kestrel
대시보드로 돌아가기
CVE-2026-55502HIGH· 7.1GHSA대응게시일: 2026. 07. 24.수정일: 2026. 07. 24.

Cloudreve OAuth Admin.Read scope can update OneDrive storage policy credentials

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
7.1high

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

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

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

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

CVSS 벡터 · 메트릭

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

상세 설명

Summary

Cloudreve 4.16.1 has an OAuth scope authorization bypass in the admin storage policy routes. An OAuth bearer token scoped to Admin.Read but not Admin.Write can call POST /api/v4/admin/policy/oauth/signin and update OneDrive storage policy credentials.

The route is inside the admin group that requires Admin.Read, but it does not add the local Admin.Write guard used by sibling policy mutation routes. Its handler persists attacker-supplied secret and app_id values into the selected OneDrive storage policy before returning an OAuth URL.

Impact

An OAuth application that was granted only read-only admin scope can modify persistent storage backend configuration for a OneDrive policy. This can break the storage backend, replace the stored application secret and app ID, and redirect future OAuth setup for that policy to attacker-controlled application parameters. The attack crosses the intended OAuth scope boundary because Admin.Write is required for sibling storage policy mutation routes.

Reproduction

Preconditions:

  1. The instance has a OneDrive storage policy.
  2. An admin user authorizes an OAuth client for Admin.Read but not Admin.Write.
  3. The OAuth client obtains a bearer access token for that admin user.

Send the following request with that read-only admin scoped token:

http
1POST /api/v4/admin/policy/oauth/signin HTTP/1.1
2Authorization: Bearer <admin OAuth token scoped to Admin.Read only>
3Content-Type: application/json
4
5{"id":1,"secret":"attacker-secret","app_id":"attacker-app-id"}

Expected secure result: the request is rejected with an insufficient-scope error because it changes storage policy credentials.

Actual result: the request reaches AdminOdOAuthURL, and GetOauthRedirectService.GetOAuth() persists the supplied values to the storage policy.

Root cause

routers/router.go applies RequiredScopes(types.ScopeAdminRead) to the authenticated admin route group. Sibling policy mutation routes add local RequiredScopes(types.ScopeAdminWrite) guards, for example policy create, policy update, CORS creation, OAuth callback, and policy delete.

The OneDrive OAuth signin route is missing that local write-scope guard:

text
1oauth.POST("signin",
2 controllers.FromJSON[adminsvc.GetOauthRedirectService](adminsvc.GetOauthRedirectParamCtx{}),
3 controllers.AdminOdOAuthURL,
4)

The handler performs a persistent write in service/admin/policy.go:

text
1policy.Settings.OauthRedirect = routes.MasterPolicyOAuthCallback(dep.SettingProvider().SiteURL(c)).String()
2policy.SecretKey = service.Secret
3policy.BucketName = service.AppID
4policy, err = storagePolicyClient.Upsert(c, policy)

The request fields secret and app_id come directly from the caller.

PoC evidence

A focused scope test confirmed that a request context with only Admin.Read fails CheckScope(c, types.ScopeAdminWrite), while Admin.Write implies Admin.Read. Therefore write routes must add RequiredScopes(types.ScopeAdminWrite) explicitly. The vulnerable route does not do so, and the handler writes the policy fields shown above.

Remediation

Add middleware.RequiredScopes(types.ScopeAdminWrite) to oauth.POST("signin", ...) before the JSON handler. Consider auditing other admin test routes that perform outbound network or mail actions under only Admin.Read, but this persistent credential update should be fixed first.

AI 심층 분석

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