{"id":"CVE-2026-32758","aliases":["CVE-2026-32758","GHSA-9f3r-2vgw-m8xp","GO-2026-4711"],"related":[],"kind":"vulnerability","state":"published","title":"File Browser has an Access Rule Bypass via Path Traversal in Copy/Rename Destination Parameter","summary":"File Browser is a file managing interface for uploading, deleting, previewing, renaming, and editing files within a specified directory. Versions 2.61.2 and below are vulnerable to Path Traversal through the resourcePatchHandler (http/resource.go). The destination path in resourcePatchHandler is validated against access rules before being cleaned/normalized, while the actual file operation calls path.Clean() afterward—resolving .. sequences into a different effective path. This allows an authenticated user with Create or Rename permissions to bypass administrator-configured deny rules (both prefix-based and regex-based) by injecting .. sequences in the destination parameter of a PATCH request. As a result, the user can write or move files into any deny-rule-protected path within their scope. However, this cannot be used to escape the user's BasePathFs scope or read from restricted paths. This issue has been fixed in version 2.62.0.","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. Versions 2.61.2 and below are vulnerable to Path Traversal through the resourcePatchHandler (http/resource.go). The destination path in resourcePatchHandler is validated against access rules before being cleaned/normalized, while the actual file operation calls path.Clean() afterward—resolving .. sequences into a different effective path. This allows an authenticated user with Create or Rename permissions to bypass administrator-configured deny rules (both prefix-based and regex-based) by injecting .. sequences in the destination parameter of a PATCH request. As a result, the user can write or move files into any deny-rule-protected path within their scope. However, this cannot be used to escape the user's BasePathFs scope or read from restricted paths. This issue has been fixed in version 2.62.0.","source":"cvelist"},{"lang":"en","text":"## Description\n\nThe `resourcePatchHandler` in `http/resource.go` validates the destination path against configured access rules before the path is cleaned/normalized. The rules engine (`rules/rules.go`) uses literal string prefix matching (`strings.HasPrefix`) or regex matching against the raw path. The actual file operation (`fileutils.Copy`, `patchAction`) subsequently calls `path.Clean()` which resolves `..` sequences, producing a different effective path than the one validated.\n\nThis allows an authenticated user with Create or Rename permissions to bypass administrator-configured deny rules by including `..` (dot-dot) path traversal sequences in the `destination` query parameter of a PATCH request.\n\n## Steps to Reproduce\n\n### 1. Verify the rule works normally\n\n```bash\n# This should return 403 Forbidden\ncurl -X PATCH \\\n  -H \"X-Auth: <alice_jwt>\" \\\n  \"http://host/api/resources/public/test.txt?action=copy&destination=%2Frestricted%2Fcopied.txt\"\n```\n\n### 2. Exploit the bypass\n\n```bash\n# This should succeed despite the deny rule\ncurl -X PATCH \\\n  -H \"X-Auth: <alice_jwt>\" \\\n  \"http://host/api/resources/public/test.txt?action=copy&destination=%2Fpublic%2F..%2Frestricted%2Fcopied.txt\"\n```\n\n### 3. Result\n\nThe file `test.txt` is copied to `/restricted/copied.txt` despite the deny rule for `/restricted/`.\n\n## Root Cause Analysis\n\nIn `http/resource.go:209-257`:\n\n```go\ndst := r.URL.Query().Get(\"destination\")       // line 212\ndst, err := url.QueryUnescape(dst)             // line 214 — dst contains \"..\"\nif !d.Check(src) || !d.Check(dst) {            // line 215 — CHECK ON UNCLEANED PATH\n    return http.StatusForbidden, nil\n}\n```\n\nIn `rules/rules.go:29-35`:\n\n```go\nfunc (r *Rule) Matches(path string) bool {\n    if r.Regex {\n        return r.Regexp.MatchString(path)      // regex on literal path\n    }\n    return strings.HasPrefix(path, r.Path)     // prefix on literal path\n}\n```\n\nIn `fileutils/copy.go:12-17`:\n\n```go\nfunc Copy(afs afero.Fs, src, dst string, ...) error {\n    if dst = path.Clean(\"/\" + dst); dst == \"\" { // CLEANING HAPPENS HERE, AFTER CHECK\n        return os.ErrNotExist\n    }\n```\n\nThe rules check sees `/public/../restricted/copied.txt` (no match for `/restricted/` prefix).\nThe file operation resolves it to `/restricted/copied.txt` (within the restricted path).\n\n## Secondary Issue\n\nIn the same handler, the error from `url.QueryUnescape` is checked after `d.Check()` runs (lines 214-220), meaning the rules check executes on a potentially malformed string if unescaping fails.\n\n## Impact\n\nAn authenticated user with Copy (Create) or Rename permission can write or move files into any path within their scope that is protected by deny rules. This bypasses both:\n\n- Prefix-based rules: `strings.HasPrefix` on uncleaned path misses the match\n- Regex-based rules: Standard patterns like `^/restricted/.*` fail on uncleaned path\n\nCannot be used to:\n\n- Escape the user's BasePathFs scope (afero prevents this)\n- Read from restricted paths (GET handler uses cleaned `r.URL.Path`)\n\n## Suggested Fix\n\nClean the destination path before the rules check:\n\n```go\ndst, err := url.QueryUnescape(dst)\nif err != nil {\n    return errToStatus(err), err\n}\ndst = path.Clean(\"/\" + dst)\nsrc = path.Clean(\"/\" + src)\nif !d.Check(src) || !d.Check(dst) {\n    return http.StatusForbidden, nil\n}\nif dst == \"/\" || src == \"/\" {\n    return http.StatusForbidden, nil\n}\n```","format":"markdown","source":"ghsa"},{"lang":"en","text":"File Browser has an Access Rule Bypass via Path Traversal in Copy/Rename Destination Parameter in github.com/filebrowser/filebrowser","format":"markdown","source":"go"},{"lang":"es","text":"File Browser es una interfaz de gestión de archivos para subir, eliminar, previsualizar, renombrar y editar archivos dentro de un directorio especificado. Las versiones 2.61.2 e inferiores son vulnerables a Salto de ruta a través del resourcePatchHandler (http/resource.go). La ruta de destino en resourcePatchHandler se valida contra las reglas de acceso antes de ser limpiada/normalizada, mientras que la operación de archivo real llama a path.Clean() después, resolviendo secuencias de .. en una ruta efectiva diferente. Esto permite a un usuario autenticado con permisos de Creación o Renombrado eludir las reglas de denegación configuradas por el administrador (tanto basadas en prefijos como en expresiones regulares) inyectando secuencias de .. en el parámetro de destino de una solicitud PATCH. Como resultado, el usuario puede escribir o mover archivos a cualquier ruta protegida por reglas de denegación dentro de su ámbito. Sin embargo, esto no puede usarse para escapar del ámbito BasePathFs del usuario o leer de rutas restringidas. Este problema ha sido solucionado en la versión 2.62.0.","source":"nvd"}],"published":"2026-03-16T20:45:12.000Z","modified":"2026-06-17T10:36:20.140Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-22","CWE-863"],"affected":[{"ranges":[{"version":"< 2.62.0","status":"affected"}],"vendor":"filebrowser","product":"filebrowser","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.62.0"}],"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.62.0"}],"ecosystem":"Go","package":"github.com/filebrowser/filebrowser/v2","purl":"pkg:golang/github.com/filebrowser/filebrowser/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.62.0"}],"vendor":"filebrowser","product":"filebrowser","cpe":"cpe:2.3:a:filebrowser:filebrowser:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/filebrowser/filebrowser/security/advisories/GHSA-9f3r-2vgw-m8xp","tags":["advisory","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/filebrowser/filebrowser/commit/4bd7d69c82163b201a987e99c0c50d7ecc6ee5f1","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/filebrowser/filebrowser/releases/tag/v2.62.0","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32758","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":"no","technicalImpact":"partial","date":"2026-03-20T20:00:32.489Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-32758","url":"https://www.cve.org/CVERecord?id=CVE-2026-32758","licence":"CVE Terms of Use","modified":"2026-03-20T20:00:43.633Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9f3r-2vgw-m8xp","url":"https://github.com/advisories/GHSA-9f3r-2vgw-m8xp","licence":"CC-BY-4.0","modified":"2026-03-30T14:00:51.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4711","url":"https://pkg.go.dev/vuln/GO-2026-4711","licence":"CC-BY-4.0","modified":"2026-03-26T21:03:18.621Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-32758","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32758","licence":"Public domain","modified":"2026-06-17T10:36:20.140Z"}],"updatedAt":"2026-11-25T22:59:16.237Z","epss":{"score":0.00427,"percentile":0.38891,"date":"2026-12-01T12:00:22.000Z"}}