CVE-2026-77637: Cloudreve Privilege Scope Bypass: State-Mutating Admin Vulnerability

LOW
Advisory Identifier: GHSA-w89x-c962-c44g
CVSS 3.8
CWE-862
Published
Advisory Summary

CVE-2026-77637 is a LOW (CVSS 3.8) privilege scope bypass: state-mutating admin vulnerability (CWE-862: Missing Authorization) affecting Cloudreve libraries in the Go ecosystem. The issue involves privilege scope bypass: state-mutating admin operations accessible via read-only oauth scope. Remediation is available by upgrading affected packages to version 4.0.0-20260715070110-bce08f88e9d8.

CVE-2026-77637 at a Glance

CVE Identifier CVE-2026-77637
GHSA Identifier GHSA-w89x-c962-c44g
Severity LOW
CVSS v3.1 Base Score 3.8
CWE Classification CWE-862: Missing Authorization
Affected Product Cloudreve
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-77637

To remediate this vulnerability, upgrade all affected Cloudreve dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/cloudreve/Cloudreve/v4 fixed: 4.0.0-20260715070110-bce08f88e9d8
Upgrade github.com/cloudreve/Cloudreve/v4 to 4.0.0-20260715070110-bce08f88e9d8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/cloudreve/Cloudreve/v4

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-77637, inspect your project dependencies for Cloudreve:

inspect dependencies for github.com/cloudreve/Cloudreve/v4

Analyze the terminal output to locate any version of Cloudreve in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.0-20260715070110-bce08f88e9d8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Cloudreve, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 <ADMIN_READ_ONLY_TOKEN>' \ '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.**

CVE-2026-77637 Affected Cloudreve Versions

1 component(s)
Fixed Versions:
4.0.0-20260715070110-bce08f88e9d8
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cloudreve/Cloudreve/v4
Go
< 4.0.0-20260715070110-bce08f88e9d8
4.0.0-20260715070110-bce08f88e9d8

References

Frequently Asked Questions

What is CVE-2026-77637?
CVE-2026-77637 is a security vulnerability in Cloudreve involving Privilege Scope Bypass: State-Mutating Admin Operations Accessible via Read-Only OAuth Scope under CWE-862: Missing Authorization.
Which Cloudreve versions are affected?
Affected versions include releases prior to 4.0.0-20260715070110-bce08f88e9d8 across affected packages: github.com/cloudreve/Cloudreve/v4.
What version fixes CVE-2026-77637?
Upgrading to 4.0.0-20260715070110-bce08f88e9d8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cloudreve/Cloudreve/v4 affected?
Yes, github.com/cloudreve/Cloudreve/v4 is affected in releases prior to 4.0.0-20260715070110-bce08f88e9d8. Upgrade your dependency to 4.0.0-20260715070110-bce08f88e9d8 or later.
What is the CVSS score of CVE-2026-77637?
CVE-2026-77637 has a CVSS v3.1 base score of 3.8 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-77637?
CVE-2026-77637 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2026-77637?
Run the dependency tree command: 'inspect dependencies for github.com/cloudreve/Cloudreve/v4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w89x-c962-c44g",
  "modified" : "2026-09-22T20:40:35Z",
  "published" : "2026-09-22T20:40:35Z",
  "aliases" : [ "CVE-2026-77637" ],
  "summary" : "Cloudreve: Privilege Scope Bypass: State-Mutating Admin Operations Accessible via Read-Only OAuth Scope",
  "details" : "### Summary\nThere 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.\n\n### Details\nThe 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.\n\nThe 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.\n\n### PoC\n```bash\n# OAuth app with ONLY Admin.Read scope can send emails:\ncurl -s -X POST -H 'Content-Type: application/json' \\\n  -H 'Authorization: Bearer <ADMIN_READ_ONLY_TOKEN>' \\\n  'https://cloudreve.example.com/api/v4/admin/tool/mail' \\\n  -d '{\"settings\":{\"smtpHost\":\"smtp.gmail.com\",\"smtpPort\":\"587\",...},\"to\":\"victim@example.com\"}'\n# Expected: 403 Forbidden (if Admin.Write was required)\n# Actual: 200 OK, email is sent\n```\n\n### Impact\nAn 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.\n\n### Fix\nAdd `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.\n\n**If possible, please apply for a CVE number when publishing. I would greatly appreciate it.**",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cloudreve/Cloudreve/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.0-20260715070110-bce08f88e9d8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cloudreve/cloudreve/security/advisories/GHSA-w89x-c962-c44g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-77637"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudreve/cloudreve/commit/bce08f88e9d8f881e78fd18e7a6598b31922c492"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cloudreve/cloudreve"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudreve/cloudreve/releases/tag/4.18.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-22T20:40:35Z",
    "nvd_published_at" : "2026-09-22T16:17:55Z"
  }
}