Skip to content
This repository was archived by the owner on Aug 31, 2026. It is now read-only.

Proxy and hook auto-provisioning ignore createUserDir and grant the server root scope

High
hacdias published GHSA-j7jh-37pf-mf8h Jul 27, 2026

Package

gomod github.com/filebrowser/filebrowser/v2 (Go)

Affected versions

<= 2.63.19

Patched versions

2.63.20

Description

Summary

File Browser's proxy and hook authentication auto-provisioning paths do not honor the isolation that createUserDir is meant to provide when the configured default scope is the CLI default ..

When createUserDir=true, the regular signup handler clears the inherited scope before calling MakeUserDir, generating a per-user directory such as /users/alice. The proxy and hook authentication paths omit this step: they pass the inherited default scope (.) directly to MakeUserDir, which normalizes it to / instead of generating a user-specific directory.

As a result, every automatically provisioned proxy-auth or hook-auth user receives the File Browser server root as its scope. With the default non-admin permissions, one valid low-privileged upstream identity can read, create, overwrite, rename, share, and delete files belonging to other users inside the File Browser root.

This is not a reverse-proxy header spoofing issue. It remains exploitable when the reverse proxy correctly authenticates the user, overwrites any client-supplied identity header, and strips the forwarded credentials. Reproduced against v2.63.18; the proxy path was runtime-verified across v2.32.0–v2.63.18 (the first release in which missing proxy users are auto-provisioned).

Affected configuration

The confirmed proxy-auth case requires:

auth.method=proxy
auth.header=X-Remote-User
createUserDir=true
defaults.scope=.   (the CLI default)

The same provisioning error exists in hook authentication when the hook authenticates a previously unknown user and does not explicitly return a different user.scope.

JSON authentication through /api/signup is not affected by this exact root-scope bug, because that handler explicitly clears the inherited scope when createUserDir is enabled.

The attacker only needs a normal upstream-authenticated account. No File Browser admin privileges are required, and no reverse-proxy bypass is required.

Root cause

MakeUserDir (settings/dir.go) only derives a username-specific home when the incoming scope is empty:

userScope = strings.TrimSpace(userScope)
if userScope == "" && s.CreateUserDir {
    username = cleanUsername(username)
    userScope = path.Join(s.UserHomeBasePath, username)
}

userScope = path.Join("/", userScope)

The proxy auto-provisioning path (auth/proxy.go) applies the defaults, including the default scope ., and then calls MakeUserDir without clearing the scope:

setting.Defaults.Apply(user)
// ...
userHome, err = setting.MakeUserDir(user.Username, user.Scope, srv.Root)

The hook auto-provisioning path (auth/hook.go) behaves equivalently:

d := &users.User{
    Username: a.Cred.Username,
    Scope:    a.Settings.Defaults.Scope,
    // ...
}
u = a.GetUser(d)
userHome, err := a.Settings.MakeUserDir(u.Username, u.Scope, a.Server.Root)

Because both pass "." instead of an empty string, MakeUserDir does not derive /users/<username>; it normalizes "." to /, and every provisioned user is saved with Scope="/".

By comparison, the signup handler already contains the missing isolation step (http/auth.go):

if d.settings.CreateUserDir {
    user.Scope = ""
}
userHome, err := d.settings.MakeUserDir(user.Username, user.Scope, d.server.Root)

Relevant locations: auth/proxy.go, auth/hook.go, settings/dir.go, http/auth.go (correct signup behavior for comparison), cmd/users.go (default scope is .).

PoC

Proxy auth, behind a real reverse proxy

The PoC uses real Nginx auth_basic, derives X-Remote-User from Nginx's authenticated $remote_user, overwrites any client-supplied X-Remote-User, and strips the Basic Auth Authorization header before forwarding to File Browser:

proxy_set_header X-Remote-User $remote_user;
proxy_set_header Authorization "";

With auth.method=proxy, auth.header=X-Remote-User, and createUserDir=true, two independently authenticated upstream users (alice, bob) are auto-created as non-admin users with the same Scope="/". A spoof attempt — Alice authenticating to Nginx while sending X-Remote-User: mallory — still authenticates as Alice, because Nginx overwrites the header before forwarding. Observed on v2.63.18:

ALICE_SAVED_SCOPE=/
BOB_SAVED_SCOPE=/
BOB_READ_BODY=secret-from-alice
ALICE_READ_AFTER_OVERWRITE_BODY=overwritten-by-bob
BOB_DELETE_STATUS=204

Bob, a different upstream user, can read, overwrite, and then delete Alice's file.

Proxy/hook auth, on loopback

The same result is reproducible without a proxy front-end, using the trusted proxy header directly:

config init --root /tmp/root --auth.method proxy --auth.header X-Remote-User --createUserDir
victim_token=$(curl -sS -X POST -H 'X-Remote-User: victim-user'   http://127.0.0.1:18081/api/login)
attacker_token=$(curl -sS -X POST -H 'X-Remote-User: attacker-user' http://127.0.0.1:18081/api/login)

users ls then shows both users saved with Scope="/", and the attacker can read, overwrite, and delete the victim's file:

ID  Username       Scope  Admin  Create  Rename  Modify  Delete  Share  Download
1   victim-user    /      false  true    true    true    true    true   true
2   attacker-user  /      false  true    true    true    true    true   true

No /users/victim-user or /users/attacker-user directory is created — the proof file is stored directly under the configured server root. Hook auth exhibits the same behavior when the hook authenticates a previously unknown user and does not return an explicit user.scope.

Impact

A valid non-admin proxy- or hook-authenticated user can access other externally-provisioned users' files even when the administrator enabled createUserDir to isolate users. Depending on the default permissions and server-root contents, the attacker can:

  • read files belonging to every other File Browser user;
  • upload files into other users' directories;
  • overwrite or rename other users' files;
  • delete other users' files or directories;
  • create public shares for data belonging to other users; and
  • access administrative or application files if they are located below the configured File Browser root.

The practical boundary violation is from one external-auth user to all data below the File Browser server root.

Patches

Fixed in v2.63.19. Auto-provisioned user creation is centralized in settings.CreateUserHome, used by signup, proxy auth, and hook auth, so the three paths cannot diverge again. When createUserDir is enabled and no explicit scope was supplied, the scope is cleared so a per-user home directory (/users/<username>) is derived; a derived scope already owned by another user is rejected (compared case-insensitively). For hook auth, an explicit user.scope returned by the trusted hook is preserved.

Workarounds

Until upgrading, do not rely on createUserDir for isolation under proxy or hook auth: assign each provisioned user an explicit, non-overlapping scope. Existing deployments should audit externally-provisioned users for Scope="/" and relocate them into per-user directories.

Credits

Independently reported by @thesmartshadow (proxy auth) and @B1gN0Se (proxy and hook auth); this advisory consolidates both reports.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CVE ID

CVE-2026-72837

Weaknesses

Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. Learn more on MITRE.

Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. Learn more on MITRE.

Credits