Rejetto HTTP File Server (versions prior to 3.2.1)
A lightweight, open-source file server that lets users share files over a network through a simple web interface.
Root Cause
The server uses JavaScript's built-in Math.random() function — which relies on an algorithm called xorshift128+ — to generate session cookies and derive the key used to sign them. This algorithm's outputs are mathematically reversible: collect enough values and you can reconstruct the internal state and recover the signing key. Think of it like a combination lock where watching someone open it a few times lets you deduce the code.
Attack Vector
An unauthenticated attacker sends a series of login requests to the server, collecting the random values returned in each response. Using those values, they reverse the algorithm to recover the signing key. They then forge a valid administrator session cookie and use it to access the server_code configuration feature, which allows remote code execution (RCE — running arbitrary commands on the target machine).
Detection Notes
Look for repeated unauthenticated login requests to your HFS instance in quick succession; unexpected changes to server configuration settings; and outbound connections from the HFS process to unfamiliar external addresses.
Recommended Actions
- Upgrade to Rejetto HFS version 3.2.1 immediately — it is available from the official Rejetto repository.
- If you cannot patch immediately, restrict access to the HFS interface to trusted IP addresses only.
- Review server logs for signs of unusual login attempts or configuration changes.

