# CVE-2024-52522: Rclone Improper Permission and Ownership Handling on Symlink Targets with --links and --metadata

> Privileged rclone copies with symlink and metadata flags allow unprivileged users to modify file ownership and permissions, leading to privilege escalation.

- **Severity:** Medium 5.4 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:L/SI:L/SA:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 Nov 2024
- **Updated:** 21 Nov 2024
- **Also known as:** BIT-rclone-2024-52522, DEBIAN-CVE-2024-52522, GHSA-hrxh-9w67-g4cv, GO-2024-3271, JLSEC-2026-279, UBUNTU-CVE-2024-52522, openSUSE-SU-2024:14524-1

## What is CVE-2024-52522?

CVE-2024-52522 is a medium-severity vulnerability in rclone, published on 15 Nov 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Rclone is a command-line program to sync files and directories to and from different cloud storage providers. Insecure handling of symlinks with --links and --metadata in rclone while copying to local disk allows unprivileged users to indirectly modify ownership and permissions on symlink target files when a superuser or privileged process performs a copy. This vulnerability could enable privilege escalation and unauthorized access to critical system files, compromising system integrity, confidentiality, and availability. This vulnerability is fixed in 1.68.2.

Weakness: CWE-59 (Improper Link Resolution Before File Access), CWE-61 (UNIX Symbolic Link (Symlink) Following), CWE-281 (Improper Preservation of Permissions)

## Which versions are affected by CVE-2024-52522?

4 open source packages ship an affected version, including github.com/rclone/rclone and rclone.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/rclone/rclone` | Go | From 1.59.0 | 1.68.2 |
| `github.com/rclone/rclone` | Go | From 1.59.0 | 1.68.2 |
| `github.com/rclone/rclone` | Go | From 1.59.0 | 1.68.2 |
| `rclone` | Bitnami | From 1.59.0 | 1.68.2 |
| `rclone` | openSUSE:Tumbleweed | All versions | 1.68.2-2.1 |

## How do I fix CVE-2024-52522?

Upgrade github.com/rclone/rclone to 1.68.2 or later.

## Is CVE-2024-52522 being exploited?

There is no known exploitation of CVE-2024-52522 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-52522 and fix it if it is affected.

What it is: CVE-2024-52522 is a medium-severity vulnerability in rclone, published on 15 Nov 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-52522 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/rclone/rclone (Go): affected from 1.59.0; fixed in 1.68.2
- github.com/rclone/rclone (Go): affected from 1.59.0; fixed in 1.68.2
- github.com/rclone/rclone (Go): affected from 1.59.0; fixed in 1.68.2
- rclone (Bitnami): affected from 1.59.0; fixed in 1.68.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-52522/ (Markdown: https://insights.sbomify.com/CVE-2024-52522/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-52522
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-52522
- OSV: https://osv.dev/vulnerability/CVE-2024-52522

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-52522/
Summaries are generated and may contain mistakes; the official description above is the record.
