{"id":"CVE-2026-55496","aliases":["CVE-2026-55496","GHSA-8r7f-r8hj-r3rv","GO-2026-6098"],"related":[],"kind":"vulnerability","state":"published","title":"Cloudreve: Inactive/banned account emails leaked via GET /api/v4/user/search because SearchActive() omits the active-status predicate","summary":"Cloudreve is a self-hosted file management and sharing system. Prior to 4.17.0, GET /api/v4/user/search calls SearchActive without adding a StatusActive predicate and serializes matches at RedactLevelUser, allowing any logged-in user to enumerate email addresses and profile metadata for inactive or banned accounts. 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. This issue is fixed in version 4.17.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Cloudreve is a self-hosted file management and sharing system. Prior to 4.17.0, GET /api/v4/user/search calls SearchActive without adding a StatusActive predicate and serializes matches at RedactLevelUser, allowing any logged-in user to enumerate email addresses and profile metadata for inactive or banned accounts. 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. This issue is fixed in version 4.17.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n \n`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.\n \nA 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.\n\n### Details\n## Root cause (verified at `26b6b10`)\n \n**1. Route — logged-in + `UserInfo.Read` scope** (`routers/router.go`):\n```go\nuser := v4.Group(\"user\")            // protected user group (login required)\nuser.GET(\"search\",\n    middleware.RequiredScopes(types.ScopeUserInfoRead),\n    controllers.FromQuery[usersvc.SearchUserService](...), controllers.UserSearch)\n```\nThe `RequiredScopes` check applies to scoped OAuth tokens; plain session requests are not gated by it — so any logged-in user reaches the search.\n \n**2. Service — 2-char keyword to `SearchActive`** (`service/user/info.go`):\n```go\ntype SearchUserService struct { Keyword string `form:\"keyword\" binding:\"required,min=2\"` }\nconst resultLimit = 10\nfunc (s *SearchUserService) Search(c *gin.Context) ([]*ent.User, error) {\n    return dep.UserClient().SearchActive(c, resultLimit, s.Keyword)\n}\n```\n \n**3. The bug — `SearchActive` has no status predicate** (`inventory/user.go`):\n```go\nfunc (c *userClient) SearchActive(ctx context.Context, limit int, keyword string) ([]*ent.User, error) {\n    ctx = context.WithValue(ctx, LoadUserGroup{}, true)\n    return withUserEagerLoading(ctx,\n        c.client.User.Query().\n            Where(user.Or(user.EmailContainsFold(keyword), user.NickContainsFold(keyword))).\n            Limit(limit),                       // <-- no user.StatusEQ(user.StatusActive)\n    ).All(ctx)\n}\n```\nContrast the siblings immediately above:\n```go\nfunc (c *userClient) GetActiveByID(...)        { ... Where(user.ID(id)).Where(user.StatusEQ(user.StatusActive)) ... }\nfunc (c *userClient) GetActiveByDavAccount(...) { ... Where(user.EmailEqualFold(email)).Where(user.StatusEQ(user.StatusActive)) ... }\n```\n`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`).\n \n**4. No global status interceptor** — `User.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.\n \n**5. Results serialized with email** (`routers/controllers/user.go` → `service/user/response.go`):\n```go\n// UserSearch:\nreturn user.BuildUserRedacted(item, user.RedactLevelUser, hasher)\n// BuildUserRedacted:\nif level == RedactLevelUser { user.Email = userRaw.Email }   // email included\n```\n \n**Secondary path:** `GET /api/v4/user/info/:id` → `GetUser` 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.)\n\n## Steps to reproduce (requires a live instance)\n \n1. Ensure a target account exists in `inactive` or `manual_banned`/`sys_banned` status (e.g., an unconfirmed registration or a banned user).\n2. As any logged-in user:\n   ```\n   GET /api/v4/user/search?keyword=<>=2 chars of the target email/nick>\n   Cookie: cloudreve-session=<attacker-session>\n   ```\n3. Observe the inactive/banned account in the results, including its `email`.\n**Expected:** only active accounts appear (matching the method name and the sibling `GetActive*` behavior).\n**Actual:** inactive/banned accounts are returned with their email addresses.\n \n## Impact\n \nAny 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.\n \n## Remediation\n \n- Add `Where(user.StatusEQ(user.StatusActive))` to `SearchActive` (matching `GetActiveByID`).\n- 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.\n- Consider not returning email from directory search at all — display name + hashed ID is usually sufficient.\n- Regression tests: searching a keyword that matches an inactive/banned account must return no result (or no email).","format":"markdown","source":"ghsa"},{"lang":"en","text":"Cloudreve: Information Exposure in `GET /api/v4/user/search`: `SearchActive` omits the active-status predicate, leaking inactive/banned account emails in github.com/cloudreve/Cloudreve","format":"markdown","source":"go"}],"published":"2026-07-24T20:46:49.000Z","modified":"2026-09-08T20:51:43.490Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-200","CWE-359"],"affected":[{"ranges":[{"version":"4.17.0","status":"affected"}],"vendor":"cloudreve","product":"cloudreve","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.0.0-20260613023921-7e1289d55279"}],"ecosystem":"Go","package":"github.com/cloudreve/Cloudreve/v4","purl":"pkg:golang/github.com/cloudreve/Cloudreve/v4","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"3.0.0-20250225100611-da4e44b77af4"}],"ecosystem":"Go","package":"github.com/cloudreve/Cloudreve/v3","purl":"pkg:golang/github.com/cloudreve/Cloudreve/v3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/cloudreve/Cloudreve","purl":"pkg:golang/github.com/cloudreve/Cloudreve","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/cloudreve/Cloudreve/v3","purl":"pkg:golang/github.com/cloudreve/Cloudreve/v3","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.0.0-20260613023921-7e1289d55279"}],"ecosystem":"Go","package":"github.com/cloudreve/Cloudreve/v4","purl":"pkg:golang/github.com/cloudreve/Cloudreve/v4","source":"go"}],"references":[{"url":"https://github.com/cloudreve/cloudreve/security/advisories/GHSA-8r7f-r8hj-r3rv","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/cloudreve/cloudreve/commit/7e1289d552794bdbeb551be78456115c87dcb3da","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/cloudreve/cloudreve/releases/tag/4.17.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/cloudreve/cloudreve","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-31T14:00:41.421Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-55496","url":"https://www.cve.org/CVERecord?id=CVE-2026-55496","licence":"CVE Terms of Use","modified":"2026-07-31T14:02:34.248Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8r7f-r8hj-r3rv","url":"https://github.com/advisories/GHSA-8r7f-r8hj-r3rv","licence":"CC-BY-4.0","modified":"2026-08-18T15:10:38.640Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6098","url":"https://pkg.go.dev/vuln/GO-2026-6098","licence":"CC-BY-4.0","modified":"2026-08-18T15:00:16.131Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-55496","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55496","licence":"Public domain","modified":"2026-09-08T20:51:43.490Z"}],"updatedAt":"2026-11-25T22:59:30.681Z","epss":{"score":0.00264,"percentile":0.19611,"date":"2026-12-01T12:00:22.000Z"}}