CVE-2026-77637: Cloudreve: Privilege Scope Bypass: State-Mutating Admin Operations Accessible via Read-Only OAuth Scope
Summary There is a privilege scope bypass in Cloudreve's admin API where two endpoints that mutate server state are missing the write-scope enforcement that their neighboring endpoints correctly apply. Specifically, the WOPI configuration fetch endpoint and the SMTP test/mail endpoint can both be triggered by an OAuth token that only has Admin.Read authorization — no Admin.Write needed.
Published Sep 22, 2026
Affected packages
github.com/cloudreve/Cloudreve/v4
- Ecosystem
- Go
- Affected
- < 4.0.0-20260715070110-bce08f88e9d8
- Fixed in
- 4.0.0-20260715070110-bce08f88e9d8
- Check
go list -m github.com/cloudreve/Cloudreve/v4
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
There is a privilege scope bypass in Cloudreve's admin API where two endpoints that mutate server state are missing the write-scope enforcement that their neighboring endpoints correctly apply. Specifically, the WOPI configuration fetch endpoint and the SMTP test/mail endpoint can both be triggered by an OAuth token that only has Admin.Read authorization — no Admin.Write needed. This breaks the intended OAuth scope boundary in a way that's subtle enough to have slipped through but meaningful enough to matter in a real deployment.
Details
The root cause is an inconsistency in how the admin tool routes are wired up in routers/router.go. The admin route group sets a baseline of ScopeAdminRead for everything underneath it (around line 868), and most write-capable endpoints inside the tool sub-group correctly layer on an additional RequiredScopes(types.ScopeAdminWrite) check on top of that. For example, the thumbnail executable setter (line 929) and the entity URL cache deletion (line 937) both do this properly.
The two endpoints that don't follow this pattern are tool.GET('wopi') (line 925) and tool.POST('mail') (line 933). Despite POST /mail clearly triggering an outbound email and GET /wopi fetching or probing WOPI service connectivity, neither has the ScopeAdminWrite guard. What that means in practice is that any OAuth application granted only Admin.Read — a scope that should be limited to inspecting configuration, not changing anything — can silently invoke both of these operations. The developer looking at the route definitions would reasonably assume all the write-adjacent tool endpoints were protected, because the ones right above and below them are. It's the kind of gap that's easy to miss in a code review.
PoC
# OAuth app with ONLY Admin.Read scope can send emails:
curl -s -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ADMIN_READ_ONLY_TOKEN>' \
'https://cloudreve.example.com/api/v4/admin/tool/mail' \
-d '{"settings":{"smtpHost":"smtp.gmail.com","smtpPort":"587",...},"to":"[email protected]"}'
# Expected: 403 Forbidden (if Admin.Write was required)
# Actual: 200 OK, email is sentImpact
An OAuth application or API key scoped to Admin.Read can send arbitrary emails through the server's configured SMTP account and probe internal WOPI service endpoints — both actions that should require elevated write authorization. In multi-party deployments where Admin.Read tokens are issued more liberally (e.g., to monitoring integrations or third-party plugins), a compromised or malicious token holder gains capabilities well beyond what the scope contract implies. Scope separation in OAuth 2.0 is a security boundary, not just a convention, and its violation here could factor into broader attack chains.
Fix
Add middleware.RequiredScopes(types.ScopeAdminWrite) as the first handler argument to both the tool.GET('wopi') and tool.POST('mail') route definitions in routers/router.go. This brings them in line with tool.POST('thumbExecutable') at line 929 and tool.DELETE('entityUrlCache') at line 937, which already follow the correct pattern. No logic changes are needed — it's purely an additive middleware insertion.
If possible, please apply for a CVE number when publishing. I would greatly appreciate it.
Credited to de3erve-hunter.
References
- https://github.com/cloudreve/cloudreve/security/advisories/GHSA-w89x-c962-c44g
- https://nvd.nist.gov/vuln/detail/CVE-2026-77637
- https://github.com/cloudreve/cloudreve/commit/bce08f88e9d8f881e78fd18e7a6598b31922c492
- https://github.com/cloudreve/cloudreve/releases/tag/4.18.0
- https://github.com/advisories/GHSA-w89x-c962-c44g
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-77633
Cloudreve: Storage-quota TOCTOU race allows quota bypass and storage-based denial of service
high7.1Sep 22, 2026CVE-2026-79913
Cloudreve: SSRF guard bypass: checkIP does not decode IPv6-transition wrappers (NAT64, IPv4-compatible, 6to4) reaching internal and cloud-metadata addresses
medium6.5Sep 22, 2026CVE-2026-54563
Cloudreve WebDAV (`/dav`) has Path Traversal / Broken Access Control — scoped DAV credential escapes its configured account root
high7.1No fixAug 26, 2026GHSA-vx2m-jpxr-xv7w
Cloudreve has Broken Access Control - Revoked Share Access Still Allows Signed File URL Generation via Cached context_hint
medium5.3No fixAug 24, 2026GHSA-w8j7-39hp-8x59
Cloudreve's remote download file paths can escape the selected destination directory
medium5.5No fixAug 24, 2026CVE-2026-55495
Cloudreve: Path Traversal in WOPI PUT_RELATIVE Allows Arbitrary File Creation in Owner Account
medium4.3No fixJul 24, 2026
