FileBrowser Authentication Bypass via Forged Proxy Authentication Header
An unauthenticated attacker can impersonate any user, including administrators, or automatically create new user accounts in FileBrowser by forging the `X-Remote-User` HTTP header when the server is configured for proxy authentication and is directly reachable, leading to full administrative control and unauthorized access to data.
A critical authentication bypass vulnerability affects FileBrowser instances configured to use proxy authentication (auth.method=proxy) where the application server is directly exposed to untrusted networks. This allows any unauthenticated attacker to impersonate any existing user, including the administrator, by simply sending a forged X-Remote-User HTTP header during a POST request to the /api/login endpoint. Additionally, specifying a non-existent username in the forged header causes FileBrowser to automatically create a new user account with default permissions, providing an account creation primitive without authorization. This vulnerability stems from FileBrowser unconditionally trusting the X-Remote-User header without any origin validation or password verification, a behavior present across all versions that support this authentication method. This is a common misconfiguration for organizations using reverse proxies for SSO/LDAP/OAuth. Successful exploitation grants full administrative control over the FileBrowser instance and access to all hosted files.
Attack Chain
- An unauthenticated attacker identifies a FileBrowser instance configured with
auth.method=proxythat is directly reachable (i.e., not exclusively behind a trusted reverse proxy). - The attacker crafts an HTTP POST request to the
/api/loginendpoint, including a forged HTTP header, typicallyX-Remote-User, set to a target username such asadmin. - FileBrowser's
ProxyAuth.Auth()function receives the request and extracts the username from theX-Remote-Userheader, implicitly trusting its value without any origin validation (e.g., checking trusted IP addresses) or cryptographic verification. - If the specified username exists, FileBrowser retrieves the corresponding user object from its internal user store. If the username does not exist, the
createUser()function is automatically invoked, creating a new user account with default permissions and a locked, random password. - The
loginHandlerproceeds to mint a valid JSON Web Token (JWT) for the impersonated or newly created user. This JWT contains the full permissions of the target user, including administrator privileges ifadminwas specified. - The attacker receives this valid JWT and uses it in subsequent HTTP requests by including it in the
X-Authheader to interact with privileged endpoints (e.g.,/api/settings,/api/users) or access specific user resources (e.g.,/api/resources/). - The attacker achieves full administrative control over the FileBrowser instance, allowing modification of server settings, enumeration of all user accounts, and unauthorized access to all files and data within the application's scope.
Impact
Successful exploitation of this vulnerability leads to complete compromise of the FileBrowser instance. Attackers gain full administrative control, allowing them to modify server configurations, create, delete, or modify files, and access sensitive data stored within the FileBrowser environment. This also enables the creation of arbitrary user accounts without authorization, potentially leading to further persistence or resource exhaustion. Organizations deploying FileBrowser behind reverse proxies, especially those exposing the application's port directly to an untrusted network (e.g., due to Docker container defaults or misconfigured cloud security groups), are at high risk of data breach and system compromise.
Recommendation
- Restrict direct access: Configure network firewalls or security groups to ensure the FileBrowser application is only accessible by trusted reverse proxies, preventing direct access from untrusted networks.
- Review logging: Deploy the provided Sigma rule to detect POST requests to
/api/logincontaining theX-Remote-Userheader. Ensure web server logs capture theX-Remote-UserHTTP header for effective detection. - Update configuration: If direct exposure is unavoidable, consider switching
auth.methodfromproxytojsonand implementing alternative, more secure authentication mechanisms at the application layer or within a properly secured reverse proxy setup. - Implement trusted proxy validation: If using
auth.method=proxyis essential, implement stringent trusted proxy validation at the network layer or enhance FileBrowser with origin validation checks (e.g., by contributing a patch to verifyr.RemoteAddragainst a list of trusted IPs).
Detection coverage 1
Detect FileBrowser Authentication Bypass Attempt via X-Remote-User Header Forgery
highDetects attempts to exploit an authentication bypass vulnerability in FileBrowser where an unauthenticated attacker forges the X-Remote-User HTTP header during a login attempt to gain unauthorized access, including administrative control or account creation. This rule assumes web server logs are configured to capture custom HTTP headers like X-Remote-User.
Detection queries are available on the platform. Get full rules →