CVE-2026-77637: Cloudreve: Privilege Scope Bypass: State-Mutating Admin Operations Accessible via Read-Only OAuth Scope

Published Sep 22, 2026
·
Updated

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 bash OAuth app with ONLY Admin.Read scope can send emails: curl -s -X POST -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <ADMINREADONLYTOKEN>' \ 'https://cloudreve.example.com/api/v4/admin/tool/mail' \ -d '{"settings":{"smtpHost":"smtp.gmail.com","smtpPort":"587",...},"to":"victim@example.com"}' Expected: 403 Forbidden (if Admin.Write was required) Actual: 200 OK, email is sent

Impact 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.

Other sources

Cloudreve is a self-hosted file management and sharing system. Prior to 4.18.0, tool.GET("wopi") and tool.POST("mail") in routers/router.go inherit ScopeAdminRead but omit the RequiredScopes(types.ScopeAdminWrite) middleware applied to neighboring state-changing admin tool routes. An OAuth application or API key limited to Admin.Read can therefore probe configured WOPI service endpoints and send arbitrary test email through the server SMTP configuration, exceeding the token's intended read-only authorization boundary. This issue is fixed in version 4.18.0.

MITRE

Affected Software

2 affected componentsFixes available
Cloudreve Cloudreve<4.18.0
go/github.com/cloudreve/Cloudreve/v4<4.0.0-20260715070110-bce08f88e9d8
4.0.0-20260715070110-bce08f88e9d8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/cloudreve/Cloudreve/v4 to a version that resolves this vulnerability.

    Fixed in 4.0.0-20260715070110-bce08f88e9d8
  2. Upgrade

    Upgrade Cloudreve to a version that resolves this vulnerability.

    Fixed in 4.18.0

Event History

Sep 22, 2026
CVE Published
via MITRE·03:30 PM
Data Sourced
via MITRE·03:30 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:17 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·08:40 PM
Data Sourced
via GitHub·08:40 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

An attacker needs an OAuth application or API key that is limited to the Admin.Read scope. No interactive user action is required, but the attacker must already possess such credentials and be able to reach the affected Cloudreve instance.

2

What operations are exposed despite the read-only scope?

An Admin.Read token can probe configured WOPI service endpoints and send arbitrary test email using the server's configured SMTP settings. These operations exceed the intended read-only authorization boundary.

3

Are deployments affected by default?

Impact depends on whether the instance has configured WOPI services or SMTP settings that can be exercised through these admin tool routes. The vulnerable authorization behavior affects Cloudreve versions before 4.18.0.

4

What should be done if upgrading is not immediately possible?

Restrict, rotate, or revoke OAuth applications and API keys with Admin.Read scope where they are not required, since those credentials can invoke the affected operations. Also limit access to the Cloudreve instance to reduce the chance that such credentials can be used remotely.

5

How can administrators determine whether they are affected?

Check the Cloudreve version: versions prior to 4.18.0 are affected. Review whether Admin.Read OAuth applications or API keys exist and whether WOPI endpoints or SMTP are configured, as these determine the available abuse paths.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203