CVE-2026-50891
Description
Filestash v0.4.0 exposes the admin configuration API during first-run setup, enabling unauthenticated remote attackers to hijack the admin plane.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Filestash v0.4.0 exposes the admin configuration API during first-run setup, enabling unauthenticated remote attackers to hijack the admin plane.
Vulnerability
An incorrect access control vulnerability exists in the /admin/api/config component of Filestash v0.4.0 [1]. The AdminOnly middleware only enforces the admin cookie check when the configuration key auth.admin is non-empty. During the initial setup, auth.admin is unset, so the API endpoint proceeds without requiring an admin session [1]. This allows an attacker to read and modify the entire admin configuration, including setting a new administrator password hash [1].
Exploitation
An attacker must have network access to a reachable, uninitialized Filestash instance (where auth.admin is still empty) [1]. The exploit requires no prior authentication or user interaction. The attacker sends a GET request to /admin/api/config to retrieve the current configuration, then replaces the auth.admin value with a bcrypt hash of a chosen password, and sends a POST request to /admin/api/config with the modified JSON body [1]. The configuration is reloaded immediately, effectively setting the attacker's password [1].
Impact
Successful exploitation results in unauthenticated administrative takeover of the Filestash instance [1]. The attacker gains full control over global configuration, storage definitions, sharing behavior, and any secrets managed through the admin console [1]. This represents a complete compromise of the application's confidentiality, integrity, and availability.
Mitigation
As of the provided references, no official patch has been released for Filestash v0.4.0 [1]. Users running an uninitialized instance should ensure that the admin interface is not exposed to untrusted networks until the initial setup is completed by a legitimate administrator [1]. Alternatively, setting a dummy auth.admin value before exposing the instance may serve as a temporary workaround. Monitor for future updates from the vendor.
AI Insight generated on Jun 15, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2- Range: =0.4.0
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"The AdminOnly middleware skips authentication when auth.admin is empty, exposing the admin configuration API during first-run setup."
Attack vector
A remote attacker who reaches a fresh Filestash 0.4.0 instance before setup completes can send a `GET /admin/api/config` request without any admin cookie to retrieve the current configuration, then `POST /admin/api/config` with a modified JSON body containing a bcrypt hash of an attacker-chosen password for the `auth.admin` field. The server accepts the input, overwrites `config.json`, and immediately reloads the configuration, granting the attacker an admin session [ref_id=1].
Affected code
The `/admin/api/config` endpoint in Filestash v0.4.0 is exposed without authentication when `auth.admin` is unset. The `AdminOnly` middleware only enforces the admin cookie check when `auth.admin` is non-empty, leaving the configuration API open during first-run setup [ref_id=1].
What the fix does
The advisory does not provide a patch diff. The recommended remediation is to require authentication for the `/admin/api/config` endpoint even when `auth.admin` is unset, or to block external access to the admin API until an administrator password has been configured [ref_id=1].
Preconditions
- configThe Filestash instance must be version 0.4.0 and in a fresh state where auth.admin is unset.
- networkThe attacker must have network access to the Filestash web interface.
Reproduction
Start a fresh Filestash 0.4.0 instance where auth.admin is unset and the web interface is reachable. Send GET /admin/api/config without an admin cookie and retrieve the current configuration JSON. Replace only the auth.admin value with a bcrypt hash of an attacker-chosen password. Send POST /admin/api/config with the modified JSON body. Send POST /admin/api/session with the attacker's cleartext password and observe a valid admin session [ref_id=1].
Generated on Jun 15, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
1News mentions
0No linked articles in our index yet.