
The SonicWall Capture Labs threat research team became aware of CVE-2026-61500, an unauthenticated session forgery vulnerability in Rejetto HTTP File Server (HFS) that leads to remote code execution (RCE), assessed its impact, and developed mitigation measures. A remote attacker can collect a small number of login responses, reconstruct the random number generator’s state, recover the signing key, and forge a valid administrator session cookie, leading to full administrative access and remote code execution via the server_code configuration feature. The vulnerability has a CVSS score of 9.8 and is classified as CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG). It has been added to CISA-KEV. Exploitation requires network access to the web interface, an unset (default) COOKIE_SIGN_KEYS environment variable, and a valid login-enabled username (e.g., admin). Rejetto HFS versions 3.0.0 through 3.2.0 (the TypeScript rewrite) are vulnerable.
Rejetto HFS is a free, self-hosted web file server that lets users share files and folders directly from their computers over a network or the internet using a standard web browser. Instead of uploading files to a third-party cloud service or setting up a complex web stack, users run HFS locally and give visitors a link to browse and download shared files.
The flaw lies in predictable PRNG output, which compromises the session authentication mechanism and ultimately allows unauthenticated remote code execution. A pseudo-random number generator (PRNG) is an algorithm that generates a sequence of numbers that appear random but are derived from an initial seed and an internal state. Unlike a true random number generator, a conventional PRNG is deterministic. Given the same initial state, it produces the same sequence of outputs. In the vulnerable HFS implementation, the session-cookie signing key is derived from Math.random(). Outputs from the same generator are also exposed during the unauthenticated Secure Remote Password (SRP) login handshake.
This creates an unintended relationship between publicly observable values and a private cryptographic secret. The weakness can compromise administrator session integrity.

The vulnerability stems from two interacting behaviors in Rejetto HFS 3.x:

The problem is not simply that the numbers are generated algorithmically. It is that Math.random() does not provide cryptographic unpredictability. HFS 3.2.1 addresses the vulnerability by using randomBytes() for cookie-signing keys and randomUUID() for login identifiers.

The vulnerability originates during session signing key initialization and becomes externally exposed through the authentication handshake. There is a distinction between the root cause, the external trigger and the eventual impact. The weak random-number generator is the root cause; exposure of its output through authentication functionality creates the attack surface. Figure 4 shows the vulnerability flow from its originating flaw to impact.
The application relies on JavaScript’s non-cryptographic Math.random() function to generate the session-cookie signing key, making the security-sensitive key potentially predictable.
The unauthenticated login handshake exposes pseudo-random values generated using the same randomness source responsible for session signing key generation.
The deterministic nature of the pseudo-random number generator allows its internal state to become potentially predictable through observable outputs, compromising the security of associated random values.
Predictability of the underlying randomness undermines the confidentiality of the session signing key, compromising the cryptographic integrity of authentication cookies.
The compromised signing key enables session-cookie forgery, allowing an unauthenticated attacker to impersonate an authenticated administrator.
The application trusts the forged session and grants administrative privileges, allowing unauthorized access to restricted server configuration and management functionality.
Unauthorized administrative access enables abuse of the privileged server_code functionality, potentially resulting in arbitrary code execution within the security context of the HFS server process.
These stages represent the logical progression of one vulnerability, not seven independent security flaws. The fundamental weakness is insecure random-number generation (CWE-338).

Figure 5 summarizes the triggering conditions. A login request alone does not cause remote code execution; it exposes the vulnerable randomness mechanism. Authentication bypass and RCE are consequences of compromised session integrity.

Exploitation begins once the attacker sends a small sequence of unauthenticated login initiation requests (loginSrp1) for the target username. After recovering the signing key and forging an administrator session cookie, the attacker uses the HFS Admin API to modify the server_code configuration setting. Because server_code allows administrators to execute custom server-side JavaScript within the Node.js runtime, the attacker achieves immediate arbitrary code execution via HTTP POST to that location.


To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signature has been released:
| Signature ID | Signature Name |
|---|---|
| IPS: 22682 | Rejetto HFS Remote Code execution |
The risks posed by CVE-2026-61500 can be mitigated or eliminated with the following measures:
Share This Article

An Article By
An Article By
Dhiren Vaghela
Dhiren Vaghela
Dhiren Vaghela has over a decade of experience in the IPS domain, with a strong focus on defensive security. His expertise lies in identifying, analyzing and mitigating vulnerabilities. Dhiren is well-versed in content-based signature writing, scanner-based alert generation and technical blog writing. By leveraging emerging technologies, he has developed numerous IPS signatures across various protocols. Known for his exceptional signature writing skills and collaborative team spirit, Dhiren is a valuable asset in the field of cybersecurity.