CVE-2026-25726
JSON

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 packageVersionsReported by
cloudreve cloudreve< 4.13.0, before 4.13.0CVE List, NVD
github.com/cloudreve/Cloudreve/v4 (Go)before 4.0.0-20260205113604-ec9fdd33bc54GitHub Advisory Database, Go Vulnerability Database
github.com/cloudreve/Cloudreve (Go)all versionsGo Vulnerability Database
github.com/cloudreve/Cloudreve/v3 (Go)all versionsGo Vulnerability Database

All scores

GitHub_M8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-338

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:

  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
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

Sources

SourceRecordLicence
CVE ListCVE-2026-25726 changed 2026-04-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-f8xp-wvcx-p6f4 changed 2026-06-25CC-BY-4.0
Go Vulnerability DatabaseGO-2026-5350 changed 2026-06-25CC-BY-4.0
NVDCVE-2026-25726 changed 2026-07-24Public domain