Summary
FileBrowser Quantum improperly joins attacker-controlled paths with a trusted base directory before sanitization, enabling directory traversal beyond the intended shared folder.
With a valid public share hash and delete permissions, an unauthenticated attacker can craft paths that escape the shared directory and delete arbitrary files within the share owner's broader storage scope.
Affected context
The issue arises in FileBrowser Quantum's public sharing feature, specifically in the delete-related endpoints:
public/api/resourcespublic/api/resources/bulk
It affects deployments where:
- Public shares are created with delete permissions enabled, and
- Public share URLs can be accessed by unauthenticated users who possess the share hash.
The vulnerable behavior occurs when a path supplied via the API is joined with a trusted base path before traversal sequences are properly sanitized, allowing escape from the intended shared directory but remaining within the configured storage scope.
Exploit preconditions
- Attack surface: HTTP API endpoints exposed by FileBrowser Quantum for public shares (
public/api/resources,public/api/resources/bulk). - Required access:
- Possession of a valid public share hash, and
- That share must have delete permissions enabled.
No authenticated user session is otherwise required.
- Trigger point: Sending crafted delete requests with path parameters containing traversal patterns (e.g.,
../) through the public API. - Why exploitation is possible: The application joins user-controlled path fragments with the base share directory prior to validating and normalizing them, so traversal sequences in the user input can break out of the shared directory and point to other locations under the owner's configured storage root.
Why this happens
This vulnerability is a classic instance of CWE-22: Path Traversal.
The underlying pattern is that the server:
- Accepts a path element from the client as part of a delete operation for resources.
- Concatenates this untrusted path with a trusted base directory to form a filesystem path.
- Only afterward attempts to sanitize or validate the combined path.
Because the validation occurs too late and does not effectively neutralize traversal sequences, relative path operators (../) and similar constructs in the untrusted input can move the resolved path outside of the intended shared directory. The file deletion logic then operates on these resolved paths, enabling deletion of arbitrary files within the configured storage scope of the share owner.
Potential impact
- Deletion of files outside the intended shared directory but within the share owner's configured storage root.
- Loss of user data, including critical application documents, media, or configuration files.
- Cascading application failures if internal data or configuration files are removed.
- Potential assistance in broader compromise when combined with other issues (e.g., deletion of log files to hinder incident response).
General mitigation guidance
Effective mitigation focuses on enforcing strict, canonical path handling and reducing the trust placed in user-supplied paths:
- Normalize and resolve user input paths against a canonical base directory before performing any filesystem operations, and validate that the resulting path remains within the allowed directory.
- Reject or strictly constrain relative components (
.and..) and other traversal-inducing constructs in API path parameters for file operations. - Avoid directly concatenating untrusted input with filesystem paths; instead use safe path-joining utilities that enforce directory boundaries.
- Implement a central authorization check for all file operations that verifies both the share permissions (e.g., delete enabled) and that the target path is inside the intended share root.
- Minimize the storage scope accessible to shares by using dedicated subdirectories for shared content and limiting their privileges, so any path-related issues have a smaller blast radius.
How teams detect issues like this
Detection typically involves both code-centric and runtime approaches:
- Static analysis and code review:
- Search for filesystem operations (delete, move, write) that use concatenated or interpolated strings built from HTTP parameters or JSON fields.
- Flag any use of user-controlled path variables combined with base directories where canonicalization and boundary checks are missing or occur after path construction.
- Enforce secure coding guidelines that require a canonicalization-and-check pattern for all path-handling logic.
- Configuration and policy enforcement:
- Apply internal coding standards or lint rules that disallow unsanitized use of
..or relative segments from API input in file paths. - Integrate SAST tools in CI/CD pipelines to detect path traversal patterns early.
- Runtime monitoring:
- Monitor filesystem activity for suspicious deletions outside known share directories initiated by web processes.
- Enable application logging for all delete operations, capturing the original user-supplied path and the resolved filesystem path for later analysis.

