GHSA-x756-g4x3-c64m Cloudreve: Non-admin remote download users can SSRF loopback/internal services and read imported responses
SummaryCloudreve's remote download workflow accepts user-supplied URLs and passes them to the configured downloader without blocking loopback, localhost, IPv6 localhost, or redirect-to-loopback targets.When the remote download permission is granted to a non-admin user group, a normal authenticated user can make the server-side downloader fetch internal-only URLs and then read the fetched response after it is imported into the user's own Cloudreve files.This does not affect default normal users unless the remote download permission is enabled for their group. However, the permission is a feature-level user-group capability and does not make the user an administrator.Attacker requirementsThe attacker must be:authenticatednon-adminin a user group where `GroupPermissionRemoteDownload` is enabledDefault normal users are blocked from the affected workflow. In the default install, only the admin group has the remote download permission, while the default `User` group does not.Affected endpointFollow-up attacker readback was performed through normal workflow and file APIs:Root causeThe remote download workflow checks whether the user group has remote download permission, but it does not validate the submitted URL before passing it to the downloader.Relevant code paths:`service/explorer/workflows.go:81``pkg/filemanager/workflows/remote_download.go:202``pkg/downloader/aria2/aria2.go:56`The application does not block loopback, localhost, IPv6 localhost, or redirect targets resolving to internal addresses.ImpactA non-admin user with remote download permission can use Cloudreve as an SSRF primitive to access services reachable from the downloader environment.In my test, the attacker could fetch internal loopback URLs and read the response body after Cloudreve imported the downloaded content into the attacker's own files.Confirmed targets:`http://127.0.0.1:7777/secret2``http://localhost:7777/localsecret``http://[::1]:7780/v6secret`redirect to `http://127.0.0.1:7777/redirsecret`This can expose internal HTTP services, loopback-only admin panels, local service metadata, or other network resources that are not directly reachable by the attacker.Reproduction1. Permission negative controlThe attacker is a normal non-admin user in the default `User` group.Before enabling remote download for the group:Response:2. Enable only remote download permission for the non-admin groupThe default install grants remote download to the admin group only. The default `User` group does not have it.Confirmed in:`inventory/migration.go:154``inventory/migration.go:179`For this test, I only changed group 2 permissions from:to:The attacker remained in the `User` group and was not made admin. `GET /api/v4/user/me` still returned the group name as `User`.3. Start an internal listenerExample listener on the Cloudreve host:The listener returned a marker response:4. Queue a remote download to loopbackResponse:The internal listener received the request:Aria2 completed the download:5. Read the imported internal response as the attackerThe task completed successfully:The attacker could list the imported file:The attacker could then download and read the response body:Additional validated variantslocalhostInput:Attacker readback:Redirect to loopbackInput:Redirect:Attacker readback:IPv6 localhostInput:Attacker readback:Expected behaviorCloudreve should reject remote download URLs that resolve to loopback, localhost, private network ranges, link-local ranges, metadata service ranges, or other internal-only targets unless explicitly allowed by an administrator.Redirect targets should be checked with the same policy.Actual behaviorCloudreve accepts the URL, passes it to the downloader, imports the fetched internal response into the attacker's files, and allows the attacker to read it.
CVSS v3.1 score: 6.5