Summary
File Browser versions prior to 2.63.1 expose a missing authorization check in the resourceGetHandler, which serves full text file contents without honoring the Perm.Download permission flag.
Users who are configured with download: false can still read any text file within their allowed directory scope via specific bypass paths, effectively gaining read access that should have been denied.
Affected context
This issue occurs in File Browser deployments where fine-grained permissions are used to restrict file downloads via the Perm.Download flag.
While endpoints such as /api/raw, /api/preview, and /api/subtitle correctly enforce this permission, the resourceGetHandler in http/resource.go does not, yet still returns full text content.
The risk is most pronounced in multi-user or shared instances where some users are intentionally prevented from downloading or viewing certain file contents but still have general interface access within a directory scope.
Exploit preconditions
- Attack surface: HTTP API / web interface of a running File Browser instance.
- Required access: Valid user account or session that:
- Has access to a specific directory or file scope.
- Has
download: falseconfigured (intended to restrict content download). - Trigger point: Invocation of the
resourceGetHandlerendpoint or its equivalent bypass paths for text content, instead of the correctly protected content-serving endpoints. - Why exploitation is possible: The handler responsible for returning text file content lacks an authorization check on the
Perm.Downloadflag, allowing content to be served as long as the user can reach the resource, even if their permissions explicitly forbid downloads.
Why this happens
The vulnerability stems from an inconsistent authorization model, where one code path that serves file content omits a critical permission check required elsewhere.
In File Browser, most content-serving endpoints correctly validate the Perm.Download flag before returning data.
However, resourceGetHandler returns text file content without performing the same permission verification, creating a "hole" in the access control logic.
This aligns with CWE-862: Missing Authorization, where an application fails to enforce access control on a resource or operation, despite having a defined permission mechanism.
Potential impact
- Users with
download: falsecan read full contents of any text file within their allowed directory scope. - Exposure of sensitive configuration data, logs, or documents that administrators intended to keep non-downloadable.
- Leakage of credentials, tokens, or API keys stored in text-based files within the user's scope.
- Undermining of organizational data governance or compliance policies that rely on restricted download permissions.
General mitigation guidance
Effective mitigation focuses on consistent, centralized authorization checks for all content-serving paths:
- Ensure all handlers that return file data consult the same permission model, including the
Perm.Downloadflag, before streaming or rendering content. - Adopt a security-by-default approach where handlers deny access unless explicit checks succeed, reducing the chance that new endpoints omit authorization.
- Factor out authorization logic into shared middleware or helper functions so that every endpoint uses the same access-control routine rather than duplicating checks.
- Use least-privilege permission configurations for users, limiting their scope only to directories and files that are appropriate for their role, even if download checks fail.
- Regularly review permission semantics and UI/UX to ensure administrators' expectations (e.g., "download disabled means content cannot be read in full") match the actual backend enforcement.
How teams detect issues like this
Detection efforts can rely on a combination of code review and behavioral monitoring:
- Static code analysis: Search for handlers that access or stream file contents without invoking shared authorization routines or checking the relevant permission flags.
- Code review patterns: During pull requests, verify that every new API endpoint performing file reads explicitly enforces
Perm.Downloador a higher-level capability check, ideally through centralized middleware. - Access logging and anomaly detection: Examine logs for requests from users with
download: falseaccessing endpoints that return full file content; flag or alert on unexpected response sizes or MIME types for restricted accounts. - Security testing and policy enforcement: Incorporate authorization test cases into automated integration tests to simulate low-privilege users accessing various content endpoints, ensuring that permission constraints are consistently applied.

