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.
Summary
File Browser's proxy and hook authentication auto-provisioning paths do not honor the isolation that
createUserDiris meant to provide when the configured default scope is the CLI default..When
createUserDir=true, the regular signup handler clears the inherited scope before callingMakeUserDir, 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 toMakeUserDir, 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 acrossv2.32.0–v2.63.18(the first release in which missing proxy users are auto-provisioned).Affected configuration
The confirmed proxy-auth case requires:
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/signupis not affected by this exact root-scope bug, because that handler explicitly clears the inherited scope whencreateUserDiris 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:The proxy auto-provisioning path (
auth/proxy.go) applies the defaults, including the default scope., and then callsMakeUserDirwithout clearing the scope:The hook auto-provisioning path (
auth/hook.go) behaves equivalently:Because both pass
"."instead of an empty string,MakeUserDirdoes not derive/users/<username>; it normalizes"."to/, and every provisioned user is saved withScope="/".By comparison, the signup handler already contains the missing isolation step (
http/auth.go):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, derivesX-Remote-Userfrom Nginx's authenticated$remote_user, overwrites any client-suppliedX-Remote-User, and strips the Basic AuthAuthorizationheader before forwarding to File Browser:With
auth.method=proxy,auth.header=X-Remote-User, andcreateUserDir=true, two independently authenticated upstream users (alice,bob) are auto-created as non-admin users with the sameScope="/". A spoof attempt — Alice authenticating to Nginx while sendingX-Remote-User: mallory— still authenticates as Alice, because Nginx overwrites the header before forwarding. Observed onv2.63.18: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:
users lsthen shows both users saved withScope="/", and the attacker can read, overwrite, and delete the victim's file:No
/users/victim-useror/users/attacker-userdirectory 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 explicituser.scope.Impact
A valid non-admin proxy- or hook-authenticated user can access other externally-provisioned users' files even when the administrator enabled
createUserDirto isolate users. Depending on the default permissions and server-root contents, the attacker can: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. WhencreateUserDiris 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 explicituser.scopereturned by the trusted hook is preserved.Workarounds
Until upgrading, do not rely on
createUserDirfor isolation under proxy or hook auth: assign each provisioned user an explicit, non-overlapping scope. Existing deployments should audit externally-provisioned users forScope="/"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.