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

Cloudreve: Information Exposure in `GET /api/v4/user/search`: `SearchActive` omits the active-status predicate, leaking inactive/banned account emails

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
4.3medium

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

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

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

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

CVSS 벡터 · 메트릭

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

상세 설명

Summary

GET /api/v4/user/search is available to any logged-in user. The service calls userClient.SearchActive, but despite its name that method filters only by email/nickname keyword and never adds a StatusActive predicate — while the sibling lookups GetActiveByID and GetActiveByDavAccount, defined a few lines above it, do. Search hits are serialized at RedactLevelUser, which includes the email address.

A normal logged-in user can therefore enumerate and retrieve the email (plus nickname, avatar, creation time, redacted group, profile share-visibility) of inactive and banned accounts that an active-user directory is supposed to suppress. No global status interceptor compensates — the only User query interceptor is soft-delete, and inactive/banned rows are not soft-deleted.

Details

Root cause (verified at 26b6b10)

1. Route — logged-in + UserInfo.Read scope (routers/router.go):

text
1user := v4.Group("user") // protected user group (login required)
2user.GET("search",
3 middleware.RequiredScopes(types.ScopeUserInfoRead),
4 controllers.FromQuery[usersvc.SearchUserService](...), controllers.UserSearch)

The RequiredScopes check applies to scoped OAuth tokens; plain session requests are not gated by it — so any logged-in user reaches the search.

2. Service — 2-char keyword to SearchActive (service/user/info.go):

text
1type SearchUserService struct { Keyword string `form:"keyword" binding:"required,min=2"` }
2const resultLimit = 10
3func (s *SearchUserService) Search(c *gin.Context) ([]*ent.User, error) {
4 return dep.UserClient().SearchActive(c, resultLimit, s.Keyword)
5}

3. The bug — SearchActive has no status predicate (inventory/user.go):

text
1func (c *userClient) SearchActive(ctx context.Context, limit int, keyword string) ([]*ent.User, error) {
2 ctx = context.WithValue(ctx, LoadUserGroup{}, true)
3 return withUserEagerLoading(ctx,
4 c.client.User.Query().
5 Where(user.Or(user.EmailContainsFold(keyword), user.NickContainsFold(keyword))).
6 Limit(limit), // <-- no user.StatusEQ(user.StatusActive)
7 ).All(ctx)
8}

Contrast the siblings immediately above:

text
1func (c *userClient) GetActiveByID(...) { ... Where(user.ID(id)).Where(user.StatusEQ(user.StatusActive)) ... }
2func (c *userClient) GetActiveByDavAccount(...) { ... Where(user.EmailEqualFold(email)).Where(user.StatusEQ(user.StatusActive)) ... }

withUserEagerLoading only eager-loads the group/passkey edges; it adds no status filter. Status values are active/inactive/manual_banned/sys_banned (ent/user/user.go).

4. No global status interceptorUser.Mixin() is CommonMixin{} (ent/schema/user.go), whose Interceptors() returns only softDeleteInterceptors (ent/schema/common.go). Inactive/banned users are not soft-deleted, so nothing filters them out at query time.

5. Results serialized with email (routers/controllers/user.goservice/user/response.go):

text
1// UserSearch:
2return user.BuildUserRedacted(item, user.RedactLevelUser, hasher)
3// BuildUserRedacted:
4if level == RedactLevelUser { user.Email = userRaw.Email } // email included

Secondary path: GET /api/v4/user/info/:idGetUser uses GetByID (no status filter), and the controller picks RedactLevelUser for any non-anonymous caller (RedactLevelAnonymous only for anonymous). So a logged-in caller with an inactive/banned user's hashed ID also receives the email-bearing profile. (Less practical than search, since it needs the hashed ID rather than a 2-char keyword.)

Steps to reproduce (requires a live instance)

  1. Ensure a target account exists in inactive or manual_banned/sys_banned status (e.g., an unconfirmed registration or a banned user).
  2. As any logged-in user:
    text
    1GET /api/v4/user/search?keyword=<>=2 chars of the target email/nick>
    2Cookie: cloudreve-session=<attacker-session>
  3. Observe the inactive/banned account in the results, including its email.
    Expected: only active accounts appear (matching the method name and the sibling GetActive* behavior).
    Actual: inactive/banned accounts are returned with their email addresses.

Impact

Any logged-in user can enumerate and harvest the email addresses (and basic profile metadata) of inactive and banned accounts that active-user lookups intentionally hide. No account access, passwords, or 2FA secrets are exposed; the impact is PII leakage and user enumeration.

Remediation

  • Add Where(user.StatusEQ(user.StatusActive)) to SearchActive (matching GetActiveByID).
  • Apply the same active-status requirement to GET /api/v4/user/info/:id, or fall back to anonymous-level redaction unless the target account is active.
  • Consider not returning email from directory search at all — display name + hashed ID is usually sufficient.
  • Regression tests: searching a keyword that matches an inactive/banned account must return no result (or no email).

AI 심층 분석

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