Summary
Filestash v0.4.0 contains a broken access control flaw in the /admin/api/config endpoint, where administrative configuration actions are insufficiently protected.
An attacker can send crafted requests to this API to gain elevated privileges and access functions intended only for administrators.
Affected context
This vulnerability appears in Filestash deployments exposing the /admin/api/config component over HTTP or HTTPS.
It is relevant when the administrative API is reachable from untrusted networks or partially trusted users and when the application does not reliably enforce role checks or session validation on this endpoint.
Environments that reuse sessions, rely on client-side checks, or share infrastructure between admin and regular interfaces are more exposed.
Exploit preconditions
- Attack surface: HTTP(S) interface of the Filestash server, specifically the
/admin/api/configroute. - Required access: Network-level access to the Filestash instance and the ability to send arbitrary HTTP requests; no valid admin account may be required if access control is bypassed.
- Trigger point: Submitting crafted requests to the admin configuration API that the server incorrectly treats as authorized.
- Why exploitation is possible: The endpoint lacks robust server-side authorization checks, allowing non-admin users or unauthenticated callers to perform actions reserved for higher-privileged roles.
Why this happens
The underlying issue falls under CWE-284: Improper Access Control, where the application fails to enforce correct permissions on sensitive operations.
In this case, the /admin/api/config endpoint appears to rely on incomplete, missing, or misapplied authorization logic.
This may manifest as relying solely on client-side controls, weak role checks, or reusing a common handler without verifying the caller's privilege level before processing configuration changes.
The abstract pattern is that administrative functionality is exposed through a URL without strict, consistent server-side enforcement of who can invoke it.
Potential impact
- Attackers can gain administrative or higher-level privileges within Filestash.
- Configuration settings may be altered, potentially weakening security or enabling additional attack vectors.
- Sensitive information stored in configuration, such as connection details or credentials, can be exposed.
- The integrity and availability of stored data and connected back-end services can be compromised through misconfiguration.
General mitigation guidance
Mitigation generally focuses on enforcing strong server-side authorization for all administrative endpoints and actions.
Common patterns include:
- Applying consistent role-based access control (RBAC) checks to every admin API route and verifying the user's role on each request.
- Requiring strong, authenticated sessions and rejecting requests without valid, non-expired authentication tokens.
- Isolating administrative interfaces on separate network paths or hosts and restricting access to trusted operators.
- Implementing least-privilege principles so that regular users and integration accounts cannot access configuration-modifying actions.
- Centralizing authorization decisions in middleware or policy layers to reduce the chance of missing checks on individual endpoints.
How teams detect issues like this
Detection often combines code-level review with runtime monitoring:
- Static analysis and manual code review can look for admin or configuration endpoints that lack explicit authorization checks or rely solely on client-controlled attributes.
- Security tests and automated integration tests can attempt to call administrative APIs with non-privileged or unauthenticated identities and verify rejection.
- Logging and monitoring can highlight suspicious use of admin APIs, such as configuration changes from unexpected IP ranges or normal user accounts.
- Policy enforcement in CI/CD, such as requiring explicit access control annotations on sensitive controllers, can help prevent regressions.

