OpenSSL
CVE-2026-25726
HIGH
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Lifecycle Timeline
3DescriptionGitHub Advisory
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)
AnalysisAI
Weak pseudo-random number generation in Cloudreve enables JWT forgery and complete account takeover on instances initialized before v4.10.0. Attackers can brute-force the PRNG seed (achievable in under 3 hours on consumer hardware) by obtaining administrator creation timestamps via public APIs and validating against known hashids, then forge valid JWTs for any user including administrators. No public exploit confirmed at time of analysis, though detailed attack methodology is disclosed. CVSS 8.1 (High) reflects network-accessible privilege escalation despite high attack complexity requiring cryptographic brute-forcing.
Technical ContextAI
Cloudreve is a self-hosted cloud storage system written in Go. The vulnerability stems from using Go's math/rand package seeded with time.Now().UnixNano() (a predictable timestamp) instead of crypto/rand for generating security-critical secrets during initial deployment. Specifically, the secret_key used for JWT signing and hash_id_salt are derived from this weak PRNG. This violates CWE-338 (Use of Cryptographically Weak Pseudo-Random Number Generator). The math/rand package is explicitly documented as unsuitable for security purposes. The seed space is constrained by the administrator account creation timestamp (publicly accessible via API), reducing brute-force complexity from theoretical billions of nanoseconds to a practical 3-hour window. Once the seed is recovered by validating against known hashids, attackers can regenerate the secret_key and craft arbitrary JWTs, bypassing authentication entirely. The vulnerable code persists across upgrades because secrets are database-persisted from initial deployment, meaning servers upgraded from pre-4.10.0 remain exploitable until secrets are manually rotated.
RemediationAI
Upgrade immediately to Cloudreve version 4.13.0, which includes automatic migration to regenerate the secret_key using cryptographically secure crypto/rand and invalidate legacy weak secrets. Download the patched release from https://github.com/cloudreve/cloudreve/releases/tag/4.13.0. For environments where immediate upgrade is not feasible, manually rotate secrets as a temporary mitigation: stop the Cloudreve service, access the database to locate the secret_key setting, replace its value with a cryptographically strong random string (generate via openssl rand -base64 64 or equivalent), and restart the service. Note that manual rotation will terminate all active user sessions. Organizations must address this on any instance ever initialized with pre-4.10.0 versions regardless of subsequent upgrades, as vulnerable secrets persist until explicitly regenerated. Complete advisory details at https://github.com/cloudreve/cloudreve/security/advisories/GHSA-f8xp-wvcx-p6f4.
The (1) TLS and (2) DTLS implementations in OpenSSL 1.0.1 before 1.0.1g do not properly handle Heartbeat Extension packe
The dtls1_reassemble_fragment function in d1_both.c in OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
The SSLv2 protocol, as used in OpenSSL before 1.0.1s and 1.0.2 before 1.0.2g and other products, requires a server to se
The ssl3_get_key_exchange function in s3_clnt.c in OpenSSL before 0.9.8zd, 1.0.0 before 1.0.0p, and 1.0.1 before 1.0.1k
The SSL protocol 3.0, as used in OpenSSL through 1.0.1i and other products, uses nondeterministic CBC padding, which mak
The AES-NI implementation in OpenSSL before 1.0.1t and 1.0.2 before 1.0.2h does not consider memory allocation during a
The X509_verify_cert function in crypto/x509/x509_vfy.c in OpenSSL 1.0.1n, 1.0.1o, 1.0.2b, and 1.0.2c does not properly
A buffer overrun can be triggered in X.509 certificate verification, specifically in name constraint checking. Rated hig
The ssl3_send_client_key_exchange function in s3_clnt.c in OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before
In OpenSSL 1.1.0 before 1.1.0d, if a malicious server supplies bad parameters for a DHE or ECDHE key exchange then this
A denial of service flaw was found in OpenSSL 0.9.8, 1.0.1, 1.0.2 through 1.0.2h, and 1.1.0 in the way the TLS/SSL proto
Same technique Privilege Escalation
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-f8xp-wvcx-p6f4