{"id":"CVE-2026-35605","aliases":["CVE-2026-35605","GHSA-5q48-q4fm-g3m6","GO-2026-5150"],"related":[],"kind":"vulnerability","state":"published","title":"File Browser has an access rule bypass via HasPrefix without trailing separator in path matching","summary":"File Browser is a file managing interface for uploading, deleting, previewing, renaming, and editing files within a specified directory. Prior to 2.63.1, the Matches() function in rules/rules.go uses strings.HasPrefix() without a trailing directory separator when matching paths against access rules. A rule for /uploads also matches /uploads_backup/, granting or denying access to unintended directories.  This vulnerability is fixed in 2.63.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"File Browser is a file managing interface for uploading, deleting, previewing, renaming, and editing files within a specified directory. Prior to 2.63.1, the Matches() function in rules/rules.go uses strings.HasPrefix() without a trailing directory separator when matching paths against access rules. A rule for /uploads also matches /uploads_backup/, granting or denying access to unintended directories.  This vulnerability is fixed in 2.63.1.","source":"cvelist"},{"lang":"en","text":"Hi,\n\nThe `Matches()` function in `rules/rules.go` uses `strings.HasPrefix()` without a trailing directory separator when matching paths against access rules. A rule for `/uploads` also matches `/uploads_backup/`, granting or denying access to unintended directories. Verified against v2.62.2 (commit 860c19d).\n\n## Details\n\nAt `rules/rules.go:29-35`:\n\n    func (r *Rule) Matches(path string) bool {\n        if r.Regex {\n            return r.Regexp.MatchString(path)\n        }\n        return strings.HasPrefix(path, r.Path)\n    }\n\nWhen a rule has `Path: \"/uploads\"`, any path starting with `/uploads` matches, including `/uploads_backup/secret.txt`. The regex variant at line 31 uses proper matching, but the non-regex path uses a prefix check without ensuring the match ends at a directory boundary.\n\nThe `Check()` function at `http/data.go:29-48` iterates all rules with last-match-wins semantics. No secondary validation exists beyond this prefix check.\n\n## PoC\n\nAdmin configures: allow rule `Path: \"/shared\"` for a restricted user.\n\nFilesystem contains:\n- `/shared/` (intended to be accessible)\n- `/shared_private/` (intended to be restricted)\n\nUser requests `/shared_private/secret.txt`:\n- `strings.HasPrefix(\"/shared_private/secret.txt\", \"/shared\")` returns true\n- Allow rule applies\n- Access granted to the unintended directory\n\n## Impact\n\nAuthenticated users can access files in sibling directories that share a common prefix with an allowed directory, bypassing the admin's intended access configuration.\n\n## Prior art\n\nPrior advisories GHSA-4mh3-h929-w968 (path-based access control bypass) and GHSA-9f3r-2vgw-m8xp (path traversal in copy/rename) addressed related access control issues. This HasPrefix prefix-collision is a distinct, unreported variant.\n\n## Suggested Fix\n\n    func (r *Rule) Matches(path string) bool {\n        if r.Regex {\n            return r.Regexp.MatchString(path)\n        }\n        prefix := r.Path\n        if prefix != \"/\" && !strings.HasSuffix(prefix, \"/\") {\n            prefix += \"/\"\n        }\n        return path == r.Path || strings.HasPrefix(path, prefix)\n    }\n\nKoda Reef\n\n---\n\n**Update:** Fix submitted as PR #5889.","format":"markdown","source":"ghsa"},{"lang":"en","text":"File Browser has an access rule bypass via HasPrefix without trailing separator in path matching in github.com/filebrowser/filebrowser","format":"markdown","source":"go"}],"published":"2026-04-07T16:24:52.307Z","modified":"2026-06-25T18:56:06.678Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 2.63.1","status":"affected"}],"vendor":"filebrowser","product":"filebrowser","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.63.1"}],"ecosystem":"Go","package":"github.com/filebrowser/filebrowser/v2","purl":"pkg:golang/github.com/filebrowser/filebrowser/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/filebrowser/filebrowser","purl":"pkg:golang/github.com/filebrowser/filebrowser","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.63.1"}],"ecosystem":"Go","package":"github.com/filebrowser/filebrowser/v2","purl":"pkg:golang/github.com/filebrowser/filebrowser/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.63.1"}],"vendor":"filebrowser","product":"filebrowser","cpe":"cpe:2.3:a:filebrowser:filebrowser:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/filebrowser/filebrowser/security/advisories/GHSA-5q48-q4fm-g3m6","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/filebrowser/filebrowser/pull/5889","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35605","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/filebrowser/filebrowser","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-04-09T14:30:12.298Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-35605","url":"https://www.cve.org/CVERecord?id=CVE-2026-35605","licence":"CVE Terms of Use","modified":"2026-04-09T14:32:02.764Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5q48-q4fm-g3m6","url":"https://github.com/advisories/GHSA-5q48-q4fm-g3m6","licence":"CC-BY-4.0","modified":"2026-06-25T18:56:06.678Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5150","url":"https://pkg.go.dev/vuln/GO-2026-5150","licence":"CC-BY-4.0","modified":"2026-06-25T18:45:26.676Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-35605","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35605","licence":"Public domain","modified":"2026-06-17T10:40:51.120Z"}],"updatedAt":"2026-11-25T22:59:18.133Z","epss":{"score":0.00416,"percentile":0.37918,"date":"2026-12-01T12:00:22.000Z"}}