Executive brief
Rclone, a tool used for managing and backing up files across different cloud storage providers, contains a vulnerability when restoring file metadata. If a user performs a backup or restore from a compromised or untrusted source while preserving metadata, an attacker can plant a malicious file that automatically gains elevated system privileges (such as root access). This could allow a local user to take full control of the system or access sensitive data belonging to other users.
Technical details
A vulnerability exists in rclone's local backend metadata handling within `backend/local/metadata.go`. When the `--metadata` or `-M` flag is used, rclone parses the source-supplied `mode`, `uid`, and `gid` and applies them directly to the local file system using `os.Chmod` and `os.Chown` without masking sensitive bits. An attacker can provide a malicious `mode` value (e.g., `40000755`) that sets the setuid or setgid bits on a binary they control. If rclone is executed by a privileged user (like root) to copy from an untrusted remote, the resulting file will be a root-owned setuid binary, enabling local privilege escalation. This issue is addressed in version 1.74.4 by masking special permission bits and requiring an explicit opt-in for ownership restoration.
Affected products
- rclone rclone <= 1.74.3
Timeline
- 2026-07-08: patched: Fix released in version 1.74.4
- 2026-08-05: advisory: GitHub Advisory published