A AegiFlow
MEDIUMCVSS 4.3

CVE-2026-55499

Cloudreve: Broken Access Control in file event stream: a single-file share recipient is subscribed to the owner's parent folder and receives activity events for unshared siblings

Published
2026-07-24
Modified
2026-07-24
Aliases
GHSA-w8x7-h2px-xmq8
Sources
github-advisory

Summary

## Summary When an authenticated recipient of a **single-file** share opens the file event stream (`GET /api/v4/file/events?uri= `), Cloudreve validates the URI by listing it and then subscribes the caller to `parent.ID()`. For a single-file share, the share navigator resolves the bare share-root URI to the **owner-side parent folder** of the shared file (not the file), while the visible listing is filtered down to just the shared file. The event hub then keys topics by numeric file ID only and, on each file change, fans the event out to subscribers of **every ancestor topic**, filtering only the client ID that caused the event — never the subscriber's share scope. Consequently, a recipient of one shared file can receive Server-Sent Events (type, sibling path/name, rename target, hashed file ID) for other files and subfolders in the owner's parent folder that were never shared. Contents are not disclosed; file-activity metadata is. ### Details ## Root cause (verified at `26b6b10`) **1. Events route — authenticated, feature-flagged, no share-scope check** (`routers/router.go`): ```go file := v4.Group("file"); file.Use(middleware.RequiredScopes(types.ScopeFilesRead)) file.GET("events", middleware.LoginRequired(), middleware.IsFunctionEnabled(func(c *gin.Context) bool { return dep.SettingProvider().EventHubEnabled(c) }), controllers.FromQuery[explorer.ExplorerEventService](...), controllers.HandleExplorerEventsPush) ``` `EventHubEnabled` defaults `true` (`inventory/setting.go: "fs_event_push_enabled":"1"`). **2. Service subscribes to the listed parent's ID** (`service/explorer/events.go`): ```go parent, _, err := m.List(c, uri, &manager.ListArgs{Page:0, PageSize:1}) // also runs share validity/password ... rx, resumed, err := eventHub.Subscribe(c, parent.ID(), requestInfo.ClientID) ``` **3. Single-file share `Root` swaps the share root to the owner parent** (`share_navigator.go`): ```go n.shareRoot = newFile(nil, share.Edges.File) ... if n.shareRoot.Type() == types.FileTypeFile { n.singleFileShare = true n.shareRoot = n.shareRoot.Parent // <-- owner-side parent folder } ``` **4. `To` returns that parent for the bare root URI** (`share_navigator.go`): ```go elements := path.Elements() if len(elements) == 1 && n.singleFileShare { return latestSharedSingleFile(...) } // only when URI names the file ... return current // current == shareRoot == owner parent folder ``` The bare root share URI has **zero** path elements (`URI.Elements()` returns nil for path `/`), so the `len(elements)==1` guard is skipped and `To` returns the parent folder. `dbfs.List` returns that as `parent`, so `parent.ID()` is the owner parent folder's real ID. **5. `Children` masks the broader parent** — for `singleFileShare` it returns only `[]*File{sharedFile}`, so the recipient's listing shows just the shared file even though the subscribed topic is the whole parent. **6. Publication fans out to ancestor topics with only a client-ID filter** (`dbfs/events.go`): ```go func (f *DBFS) getEligibleSubscriber(ctx, file, checkParentPerm) []foundSubscriber { roots := file.Ancestors() for _, root := range roots { subscribers := f.eventHub.GetSubscribers(ctx, root.Model.ID) subscribers = lo.Filter(subscribers, func(s eventhub.Subscriber, _ int) bool { return !(requestInfo != nil && s.ID() == requestInfo.ClientID) // ONLY exclude the causing client }) ... } } // emit*: From: subscriber.relativePath(file) // owner-side path of the changed sibling ``` `relativePath` trims the changed file's owner path by the subscribed root's owner path, yielding the sibling's name (e.g. `/Secret-Plan.pdf`). No check that the subscriber is authorized for the changed file or within their share scope. ## Validation performed Independent validation against commit `26b6b10` in a clean sandbox. **Source-verified (static):** all of (1)–(6) confirmed verbatim, including the negativ

Affected packages

EcosystemPackageAffected versionsFixed versions
Gogithub.com/cloudreve/Cloudreve/v44.0.0-20260613030215-0b00dd308f13
Gogithub.com/cloudreve/Cloudreve/v3

Remediation: Upgrade to 4.0.0-20260613030215-0b00dd308f13 or later.

References

Includes data from the GitHub Advisory Database, licensed under CC-BY 4.0.

CVE® is a registered trademark of The MITRE Corporation. CVE content reproduced under the CVE Terms of Use; copyright designation © MITRE.