CVE-2026-25726: Github.com/cloudreve/Cloudreve/v4 Cloudreve Is Vulnerable To Account Vulnerability

HIGH
Advisory Identifier: GHSA-f8xp-wvcx-p6f4
CVSS 8.1
CWE-338
Published
Advisory Summary

CVE-2026-25726 is a HIGH (CVSS 8.1) cloudreve is vulnerable to account vulnerability (CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)) affecting Github.com/cloudreve/Cloudreve/v4 libraries in the Go ecosystem. The issue involves cloudreve is vulnerable to account takeover via weak cryptographic token generation (insecure prng seeding). Remediation is available by upgrading affected packages to version 4.0.0-20260205113604-ec9fdd33bc54.

CVE-2026-25726 at a Glance

CVE Identifier CVE-2026-25726
GHSA Identifier GHSA-f8xp-wvcx-p6f4
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Affected Product Github.com/cloudreve/Cloudreve/v4
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

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

How to Fix CVE-2026-25726

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-20260205113604-ec9fdd33bc54
Upgrade github.com/cloudreve/Cloudreve/v4 to 4.0.0-20260205113604-ec9fdd33bc54
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-25726, 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-20260205113604-ec9fdd33bc54), 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-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG), where the product uses a pseudo-random number generator (prng) in a security context, but the prng's algorithm is not cryptographically strong. 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

### Impact This vulnerability affects **Cloudreve** instances that were **first deployed/initialized** with versions prior to V4.10.0. The application uses the weak pseudo-random number generator `math/rand` seeded with `time.Now().UnixNano()` to generate critical security secrets, including the `secret_key`, and `hash_id_salt`. These secrets are generated upon first startup and persisted in the database. An attacker can exploit this by obtaining the administrator's account creation time (via public API endpoints) to narrow the search window for the PRNG seed, and use known hashid to validate the seed. By brute-forcing the seed (demonstrated to take <3 hours on general consumer PC), an attacker can predict the `secret_key`. This allows them to forge valid JSON Web Tokens (JWTs) for any user, including administrators, leading to full account takeover and privilege escalation. **Note**: Servers running V4.10.0+ are still vulnerable if they were originally installed using an older version, as the weak secrets persist in the configuration. ### Patches The issue has been addressed in version 4.13.0. This patch introduces a migration mechanism that automatically: 1. Invalidate the existing `secret_key`. 2. Regenerate a new, cryptographically secure `secret_key` using crypto/rand. Users should upgrade to 4.13.0 immediately. ### Workarounds If an immediate upgrade is not possible, administrators must manually rotate the critical secrets in the configuration file to invalidate potential exploits: 1. Stop the Cloudreve service. 2. In Cloudreve database, locate `secret_key` setting. 3. Replace the value with a long, random string (e.g., generated via `openssl rand -base64 64`). 4. Restart the Cloudreve service. _Note: This will log out all currently active users._ ### Resources * Vulnerable Code (Seeding): https://github.com/cloudreve/cloudreve/blob/87d48ac4a7acbc68064c2b9cb23793ac97f4392d/pkg/util/common.go#L21C1-L23C2 * Vulnerable Code (Usage): https://github.com/cloudreve/cloudreve/blob/87d48ac4a7acbc68064c2b9cb23793ac97f4392d/inventory/setting.go#L591 * [Go Documentation (math/rand)](https://pkg.go.dev/math/rand)

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

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

References

Frequently Asked Questions

What is CVE-2026-25726?
CVE-2026-25726 is a security vulnerability in Github.com/cloudreve/Cloudreve/v4 involving Cloudreve is vulnerable to Account Takeover via Weak Cryptographic Token Generation (Insecure PRNG Seeding) under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG).
Which Github.com/cloudreve/Cloudreve/v4 versions are affected?
Affected versions include releases prior to 4.0.0-20260205113604-ec9fdd33bc54 across affected packages: github.com/cloudreve/Cloudreve/v4.
What version fixes CVE-2026-25726?
Upgrading to 4.0.0-20260205113604-ec9fdd33bc54 (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-20260205113604-ec9fdd33bc54. Upgrade your dependency to 4.0.0-20260205113604-ec9fdd33bc54 or later.
What is the CVSS score of CVE-2026-25726?
CVE-2026-25726 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-25726?
CVE-2026-25726 is classified under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) (The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.).
How can I check Go dependencies for CVE-2026-25726?
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-f8xp-wvcx-p6f4",
  "modified" : "2026-04-06T23:09:44Z",
  "published" : "2026-03-31T22:31:54Z",
  "aliases" : [ "CVE-2026-25726" ],
  "summary" : "Cloudreve is vulnerable to Account Takeover via Weak Cryptographic Token Generation (Insecure PRNG Seeding)",
  "details" : "### Impact\nThis vulnerability affects **Cloudreve** instances that were **first deployed/initialized** with versions prior to V4.10.0.\n\nThe application uses the weak pseudo-random number generator `math/rand` seeded with `time.Now().UnixNano()` to generate critical security secrets, including the `secret_key`, and `hash_id_salt`. These secrets are generated upon first startup and persisted in the database.\n\nAn attacker can exploit this by obtaining the administrator's account creation time (via public API endpoints) to narrow the search window for the PRNG seed, and use known hashid to validate the seed. By brute-forcing the seed (demonstrated to take <3 hours on general consumer PC), an attacker can predict the `secret_key`. This allows them to forge valid JSON Web Tokens (JWTs) for any user, including administrators, leading to full account takeover and privilege escalation.\n\n**Note**: Servers running V4.10.0+ are still vulnerable if they were originally installed using an older version, as the weak secrets persist in the configuration.\n\n### Patches\nThe issue has been addressed in version 4.13.0.\nThis patch introduces a migration mechanism that automatically:\n\n1. Invalidate the existing `secret_key`.\n2. Regenerate a new, cryptographically secure `secret_key` using crypto/rand.\n\nUsers should upgrade to 4.13.0 immediately.\n\n### Workarounds\nIf an immediate upgrade is not possible, administrators must manually rotate the critical secrets in the configuration file to invalidate potential exploits:\n\n1. Stop the Cloudreve service.\n2. In Cloudreve database, locate `secret_key` setting.\n3. Replace the value with a long, random string (e.g., generated via `openssl rand -base64 64`).\n4. Restart the Cloudreve service.\n\n_Note: This will log out all currently active users._\n\n### Resources\n* Vulnerable Code (Seeding): https://github.com/cloudreve/cloudreve/blob/87d48ac4a7acbc68064c2b9cb23793ac97f4392d/pkg/util/common.go#L21C1-L23C2\n* Vulnerable Code (Usage): https://github.com/cloudreve/cloudreve/blob/87d48ac4a7acbc68064c2b9cb23793ac97f4392d/inventory/setting.go#L591\n* [Go Documentation (math/rand)](https://pkg.go.dev/math/rand)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cloudreve/Cloudreve/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.0-20260205113604-ec9fdd33bc54"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cloudreve/cloudreve/security/advisories/GHSA-f8xp-wvcx-p6f4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25726"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cloudreve/cloudreve"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudreve/cloudreve/releases/tag/4.13.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-338" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-31T22:31:54Z",
    "nvd_published_at" : "2026-04-03T20:16:02Z"
  }
}