Summary
A path traversal and authorization confusion issue in rclone's serve restic --private-repos mode lets an authenticated user craft URL paths containing .. to target other users' private repositories on certain backends.
When backends normalize path components, this mismatch between routed user identity and backend object key can allow reading, overwriting, or deleting another user's data.
Affected context
The vulnerability occurs in deployments using rclone serve restic --private-repos with backends that normalize or clean path components (such as treating .. segments as directory traversal).
In this context, rclone enforces authorization based on the routed user path segment, but derives the backend object key from the raw, uncleaned URL path.
When these two interpretations diverge, a user's request can be authorized for one repository while actually pointing to another user's repository on the backend.
Exploit preconditions
- Attack surface: HTTP interface exposed by
rclone serve restic --private-repos - Required access: Valid authenticated user account with access to their own private repository
- Trigger point: Crafted REST requests embedding
..or similar path manipulation in URL segments (e.g.,//..//config) - Why exploitation is possible: Authorization decisions use the routed, cleaned user path, while backend object resolution uses the raw uncleaned URL path; backend path normalization then resolves the manipulated path into another user's repository.
Why this happens
The core issue is a mismatch between authorization logic and storage path resolution, combining CWE-22: Path Traversal with CWE-639: Insecure Direct Object Reference.
Rclone checks permissions using a sanitized routing segment representing the authenticated user's repository, but constructs backend object keys directly from the uncleaned URL path.
On backends that normalize path components (including ..), this allows a user-controlled URL to traverse to objects outside their own repository while still passing the authorization checks, violating repository isolation assumptions.
Potential impact
- An authenticated user may read another user's private restic repository data.
- An authenticated user may overwrite or corrupt backups belonging to other users.
- An authenticated user could delete other users' backup content, causing data loss.
- Cross-tenant data exposure and integrity violations can occur on shared rclone-backed storage.
General mitigation guidance
Effective mitigation typically focuses on aligning authorization decisions with the exact paths used at the storage layer and eliminating opportunities for path traversal.
Common defensive patterns include:
- Normalizing and validating URL paths before authorization checks and backend key construction, ensuring both use the same cleaned representation.
- Rejecting requests containing
.., duplicate slashes, or other ambiguous path constructs for repository-scoped APIs. - Implementing strict repository scoping, where the repository identifier is not solely derived from user-controlled path segments.
- Reducing privileges of the service account used to access backend storage so that it cannot access unrelated tenant data.
- Designing APIs so that identifiers for sensitive objects (repositories, buckets) are not directly manipulable through free-form paths.
How teams detect issues like this
Detection efforts can focus on identifying both flawed path handling and suspicious access patterns.
Useful approaches include:
- Static analysis rules that flag uses of raw URL paths when constructing backend keys, especially alongside separate authorization checks.
- Code reviews that verify path normalization occurs once and that the same normalized value drives routing, authorization, and backend access.
- Logging and monitoring of repository access to detect cross-user access anomalies, such as a single user accessing multiple distinct repositories unexpectedly.
- Policy enforcement in CI/CD pipelines that require consistent path sanitization practices and prohibit use of user-controlled paths for direct object reference.
- Optional use of automated security scanning tools that understand CWE-22 and CWE-639 patterns to highlight risky URL/path usage.

