CVE-2026-25726: Cloudreve is vulnerable to Account Takeover via Weak Cryptographic Token Generation (Insecure PRNG Seeding)

Published Mar 31, 2026
·
Updated

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 secretkey, and hashidsalt. 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 secretkey. 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 secretkey. 2. Regenerate a new, cryptographically secure secretkey 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 secretkey 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)

Other sources

Cloudreve is a self-hosted file management and sharing system. Prior to version 4.13.0, the application uses the weak pseudo-random number generator math/rand seeded with time.Now().UnixNano() to generate critical security secrets, including the secretkey, and hashidsalt. 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 secretkey. This allows them to forge valid JSON Web Tokens (JWTs) for any user, including administrators, leading to full account takeover and privilege escalation. This issue has been patched in version 4.13.0.

MITRE

Affected Software

2 affected componentsFixes available
go/github.com/cloudreve/Cloudreve/v4<4.0.0-20260205113604-ec9fdd33bc54
4.0.0-20260205113604-ec9fdd33bc54
Cloudreve Cloudreve<4.13.0

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-20260205113604-ec9fdd33bc54
  2. Upgrade

    Upgrade cloudreve to a version that resolves this vulnerability.

    Fixed in 4.13.0
  3. Operational

    If immediate upgrade is not possible, manually rotate the critical secrets in the configuration/database: in Cloudreve database, locate `secret_key`, invalidate the existing `secret_key`, regenerate a new cryptographically secure `secret_key` using `crypto/rand` (e.g., replace with a long random string such as generated via `openssl rand -base64 64`), then restart the Cloudreve service.

  4. Operational

    After applying the workaround/rotation or upgrading to 4.13.0, expect that the upgrade will log out all currently active users.

  5. Operational

    Stop the Cloudreve service before replacing `secret_key`, then start/restart the Cloudreve service after the new value is set.

Event History

Mar 31, 2026
Advisory Published
via GitHub·10:31 PM
Data Sourced
via GitHub·10:31 PM
DescriptionSeverityWeaknessAffected Software
Apr 3, 2026
CVE Published
via MITRE·08:06 PM
Data Sourced
via MITRE·08:06 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-25726?

CVE-2026-25726 has a critical severity due to the use of a weak pseudo-random number generator for generating security secrets.

2

How do I fix CVE-2026-25726?

To fix CVE-2026-25726, upgrade your Cloudreve instance to version 4.10.0 or later.

3

What is the impact of CVE-2026-25726?

The impact of CVE-2026-25726 includes potential exposure of security secrets, which could lead to unauthorized access.

4

Which versions of Cloudreve are affected by CVE-2026-25726?

CVE-2026-25726 affects Cloudreve instances that were initialized with versions prior to V4.10.0.

5

Is there a workaround for CVE-2026-25726?

There is no official workaround for CVE-2026-25726; the recommended solution is to update to the latest version.

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