{"id":"CVE-2026-54091","aliases":["GHSA-j9jx-hp4c-ghhh"],"title":"File Browser has incorrect access control for public directory shares via rule path rebasing","summary":"File Browser has incorrect access control for public directory shares via rule path rebasing","severity":"high","cvss":7.5,"cwe":["CWE-863"],"vendor":"filebrowser","product":"github.com/filebrowser/filebrowser/v2","ecosystem":"go","affected":["github.com/filebrowser/filebrowser/v2 <= 2.63.5","github.com/filebrowser/filebrowser <= 1.11.0"],"patched":["github.com/filebrowser/filebrowser/v2 2.63.6"],"published":"2026-06-12","updated":"2026-06-12","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-j9jx-hp4c-ghhh","references":[{"url":"https://github.com/filebrowser/filebrowser/security/advisories/GHSA-j9jx-hp4c-ghhh"},{"url":"https://github.com/filebrowser/filebrowser/commit/e07c59df0b850f5924d5b1683e8609661ddcf534"},{"url":"https://github.com/filebrowser/filebrowser/releases/tag/v2.63.6"},{"url":"https://github.com/advisories/GHSA-j9jx-hp4c-ghhh"}],"tags":["ghsa","go"],"epss":0.00516,"epssPercentile":0.42738,"ingestedAt":"2026-07-07T15:41:58.972Z","slug":"CVE-2026-54091","body":"## Overview\n\n### Summary\nFile Browser's public share handlers rebase the share owner's filesystem root to the shared directory and then evaluate descendant paths against the owner's global and per-user rules using the rebased relative path instead of the original path relative to the owner's scope.\n\nAs a result, an attacker who knows a public directory share URL can access files and subdirectories that the owner explicitly blocked with rules, as long as those blocked paths are located underneath the shared directory. In the simplest case this is an unauthenticated information disclosure through `GET /api/public/share/*` and `GET /api/public/dl/*`.\n\n### Details\nThe public share flow first resolves the original shared path under the owner's filesystem, but then switches `d.user.Fs` to a new `BasePathFs` rooted at the shared directory. The follow-up authorization check is still performed by `d.Check`, which compares the request path to rule strings using prefix matching.\n\nWhen the share target is a directory, the path passed to `d.Check` becomes relative to the shared directory, while the rules remain relative to the owner's original scope. A deny rule such as `/projects/private` therefore no longer matches a public share request for `/private/secret.txt`, even though the rebased filesystem resolves that request to the real path `/projects/private/secret.txt`.\n\nCore vulnerable code path:\n\n```go\n// http/public.go\nif file.IsDir {\n    basePath = filepath.Clean(link.Path)\n    filePath = ifPath\n}\n\nd.user.Fs = afero.NewBasePathFs(d.user.Fs, basePath)\n\nfile, err = files.NewFileInfo(&files.FileOptions{\n    Fs:      d.user.Fs,\n    Path:    filePath,\n    Expand:  true,\n    Checker: d,\n})\n```\n\n```go\n// http/data.go and rules/rules.go\nfunc (d *data) Check(path string) bool {\n    allow := true\n    for _, rule := range d.settings.Rules {\n        if rule.Matches(path) {\n            allow = rule.Allow\n        }\n    }\n    for _, rule := range d.user.Rules {\n        if rule.Matches(path) {\n            allow = rule.Allow\n        }\n    }\n    return allow\n}\n\nfunc (r *Rule) Matches(path string) bool {\n    if path == r.Path {\n        return true\n    }\n    prefix := r.Path\n    if prefix != \"/\" && !strings.HasSuffix(prefix, \"/\") {\n        prefix += \"/\"\n    }\n    return strings.HasPrefix(path, prefix)\n}\n```\n\nThe issue is reachable from the public endpoints registered in `http/http.go` for `/api/public/share/*` and `/api/public/dl/*`.\n\n### PoC\nThe attacker only needs a directory share URL. No authenticated session is required if the share is not password protected.\n\nReproduction flow:\n\n1. Prepare a directory owned by a normal user, for example `/projects/`.\n2. Inside it, create a sensitive child path such as `/projects/private/secret.txt`.\n3. Configure a deny rule for the share owner that blocks `/projects/private`.\n4. Have the owner create a public share for `/projects/`.\n5. Request the blocked child path through the public share endpoints.\n\nPoC:\n\n```bash\n# owner creates a public share for /projects/\ncurl -s -X POST 'http://HOST/api/share/projects/' \\\n  -H 'X-Auth: <OWNER_JWT>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{}'\n```\n\nThe response contains a share hash such as:\n\n```text\n{\"hash\":\"<HASH>\",\"path\":\"/projects/\",\"userID\":2,\"expire\":0}\n```\n\nThe attacker can then access a rule-blocked file below the shared directory:\n\n```bash\ncurl -i 'http://HOST/api/public/dl/<HASH>/private/secret.txt'\n```\n\nA blocked subdirectory can also be listed directly:\n\n```bash\ncurl -i 'http://HOST/api/public/share/<HASH>/private/'\n```\n\nthe server returns `200 OK` and serves the file content or directory listing, even though the share owner's rules should have made that path inaccessible.\n\n### Impact\nThis flaw allows public share recipients to read files and browse directories that the share owner explicitly intended to block with File Browser rules. Because the vulnerable path is the public share feature, the exposure can be unauthenticated and internet-reachable whenever a share link is exposed.\n\nIn practical deployments, this can disclose secrets, configuration files, backup material, private project directories, or any other content that administrators or users attempted to hide beneath a shared parent directory using the built-in rule system.\n\n## Affected packages\n\n- `github.com/filebrowser/filebrowser/v2 <= 2.63.5`\n- `github.com/filebrowser/filebrowser <= 1.11.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `github.com/filebrowser/filebrowser/v2 2.63.6`","depth":"twilight","depthScore":41,"depthScoreParts":{"impact":41.3,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}