8.1high
Cloudreve is vulnerable to Account Takeover via Weak Cryptographic Token Generation (Insecure PRNG Seeding)
- Severity
- 8.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.43% (higher than 38% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-f8xp-wvcx-p6f4GO-2026-5350
Description
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 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. This issue has been patched in version 4.13.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| cloudreve cloudreve | < 4.13.0, before 4.13.0 | CVE List, NVD |
| github.com/cloudreve/Cloudreve/v4 (Go) | before 4.0.0-20260205113604-ec9fdd33bc54 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/cloudreve/Cloudreve (Go) | all versions | Go Vulnerability Database |
| github.com/cloudreve/Cloudreve/v3 (Go) | all versions | Go Vulnerability Database |
All scores
| GitHub_M | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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 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. This issue has been patched in version 4.13.0.
GitHub Advisory Database
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:
- Invalidate the existing
secret_key. - Regenerate a new, cryptographically secure
secret_keyusing 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:
- Stop the Cloudreve service.
- In Cloudreve database, locate
secret_keysetting. - Replace the value with a long, random string (e.g., generated via
openssl rand -base64 64). - 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)
Go Vulnerability Database
Cloudreve is vulnerable to Account Takeover via Weak Cryptographic Token Generation (Insecure PRNG Seeding) in github.com/cloudreve/Cloudreve
NVD (es)
Cloudreve es un sistema de gestión y compartición de archivos autoalojado. Antes de la versión 4.13.0, la aplicación utiliza el generador de números pseudoaleatorios débil math/rand inicializado con time.Now().UnixNano() para generar secretos de seguridad críticos, incluyendo la secret_key y el hash_id_salt. Estos secretos se generan en el primer inicio y se persisten en la base de datos. Un atacante puede explotar esto obteniendo el tiempo de creación de la cuenta del administrador (a través de puntos finales de la API públicos) para reducir la ventana de búsqueda para la semilla del PRNG, y usar un hashid conocido para validar la semilla. Mediante fuerza bruta sobre la semilla (demostrado que toma <3 horas en una PC de consumidor general), un atacante puede predecir la secret_key. Esto les permite falsificar JSON Web Tokens (JWTs) válidos para cualquier usuario, incluidos los administradores, lo que lleva a una toma de control total de la cuenta y escalada de privilegios. Este problema ha sido parcheado en la versión 4.13.0.
References
| https://github.com/cloudreve/cloudreve/security/advisories/GHSA-f8xp-wvcx-p6f4 | advisory, mitigation, vendor-advisory, web | |
| https://github.com/cloudreve/cloudreve/releases/tag/4.13.0 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-25726 | advisory | |
| https://github.com/cloudreve/cloudreve | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-25726 changed 2026-04-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-f8xp-wvcx-p6f4 changed 2026-06-25 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5350 changed 2026-06-25 | CC-BY-4.0 |
| NVD | CVE-2026-25726 changed 2026-07-24 | Public domain |