# CVE-2024-12087: Rsync: path traversal vulnerability in rsync

> A malicious rsync server can write files to arbitrary locations on the client system due to improper symlink verification during recursive transfers.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Jan 2025
- **Updated:** 21 Oct 2026
- **Also known as:** ALPINE-CVE-2024-12087, AZL-55655, AZL-55682, BELL-CVE-2024-12087, CLSA-2025-1738833802, CLSA-2025-1738958235, CLSA-2025-1751612441, CLSA-2025-1751913256, CLSA-2025-1757608663, DEBIAN-CVE-2024-12087, GHSA-9x68-7qq6-v523, JLSEC-2025-326, RHSA-2025:23154, RHSA-2025:23235, RHSA-2025:23407, RHSA-2025:23415, RHSA-2025:23416, RHSA-2025:23842, RHSA-2025:23853, RHSA-2025:23854, RHSA-2025:23858, UBUNTU-CVE-2024-12087

## What is CVE-2024-12087?

CVE-2024-12087 is a medium-severity path traversal vulnerability in Gentoo Linux, published on 14 Jan 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

A path traversal vulnerability exists in rsync. It stems from behavior enabled by the `--inc-recursive` option, a default-enabled option for many client options and can be enabled by the server even if not explicitly enabled by the client. When using the `--inc-recursive` option, a lack of proper symlink verification coupled with deduplication checks occurring on a per-file-list basis could allow a server to write files outside of the client's intended destination directory. A malicious server could write malicious files to arbitrary locations named after valid directories/paths on the client.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

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

It affects 18 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rsync` | Red Hat:rhel_aus:8.2::baseos | All versions | 0:3.1.3-7.el8_2.6 |
| `rsync-daemon` | Red Hat:rhel_aus:8.2::baseos | All versions | 0:3.1.3-7.el8_2.6 |
| `rsync-debuginfo` | Red Hat:rhel_aus:8.2::baseos | All versions | 0:3.1.3-7.el8_2.6 |
| `rsync-debugsource` | Red Hat:rhel_aus:8.2::baseos | All versions | 0:3.1.3-7.el8_2.6 |
| `rsync` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |
| `rsync-daemon` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |
| `rsync-debuginfo` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |
| `rsync-debugsource` | Red Hat:rhel_aus:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |
| `rsync` | Red Hat:rhel_aus:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync-daemon` | Red Hat:rhel_aus:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync-debuginfo` | Red Hat:rhel_aus:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync-debugsource` | Red Hat:rhel_aus:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync` | Red Hat:rhel_e4s:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync-daemon` | Red Hat:rhel_e4s:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync-debuginfo` | Red Hat:rhel_e4s:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync-debugsource` | Red Hat:rhel_e4s:8.6::baseos | All versions | 0:3.1.3-14.el8_6.9 |
| `rsync` | Red Hat:rhel_e4s:8.8::baseos | All versions | 0:3.1.3-20.el8_8.4 |
| `rsync-daemon` | Red Hat:rhel_e4s:8.8::baseos | All versions | 0:3.1.3-20.el8_8.4 |
| `rsync-debuginfo` | Red Hat:rhel_e4s:8.8::baseos | All versions | 0:3.1.3-20.el8_8.4 |
| `rsync-debugsource` | Red Hat:rhel_e4s:8.8::baseos | All versions | 0:3.1.3-20.el8_8.4 |
| `rsync-daemon` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.2.3-9.el9_0.4 |
| `rsync` | Red Hat:rhel_e4s:9.0::baseos | All versions | 0:3.2.3-9.el9_0.4 |
| `rsync-debuginfo` | Red Hat:rhel_e4s:9.0::baseos | All versions | 0:3.2.3-9.el9_0.4 |
| `rsync-debugsource` | Red Hat:rhel_e4s:9.0::baseos | All versions | 0:3.2.3-9.el9_0.4 |
| `rsync-daemon` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:3.2.3-19.el9_2.2 |
| `rsync` | Red Hat:rhel_e4s:9.2::baseos | All versions | 0:3.2.3-19.el9_2.2 |
| `rsync-debuginfo` | Red Hat:rhel_e4s:9.2::baseos | All versions | 0:3.2.3-19.el9_2.2 |
| `rsync-debugsource` | Red Hat:rhel_e4s:9.2::baseos | All versions | 0:3.2.3-19.el9_2.2 |
| `rsync` | Red Hat:rhel_els:6 | All versions | 0:3.0.6-12.el6_10.2 |
| `rsync-debuginfo` | Red Hat:rhel_els:6 | All versions | 0:3.0.6-12.el6_10.2 |
| `rsync` | Red Hat:rhel_els:7 | All versions | 0:3.1.2-12.el7_9.2 |
| `rsync-debuginfo` | Red Hat:rhel_els:7 | All versions | 0:3.1.2-12.el7_9.2 |
| `rsync-daemon` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.2.3-19.el9_4.2 |
| `rsync` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:3.2.3-19.el9_4.2 |
| `rsync-debuginfo` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:3.2.3-19.el9_4.2 |
| `rsync-debugsource` | Red Hat:rhel_eus:9.4::baseos | All versions | 0:3.2.3-19.el9_4.2 |
| `rsync` | Red Hat:rhel_eus_long_life:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |
| `rsync-daemon` | Red Hat:rhel_eus_long_life:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |
| `rsync-debuginfo` | Red Hat:rhel_eus_long_life:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |
| `rsync-debugsource` | Red Hat:rhel_eus_long_life:8.4::baseos | All versions | 0:3.1.3-12.el8_4.6 |

Products: Almalinux Almalinux, Archlinux Arch Linux, Gentoo Linux, Nixos Nixos, Redhat Enterprise Linux, Redhat Enterprise Linux Eus, Redhat Enterprise Linux for Arm 64, Redhat Enterprise Linux for Arm 64 Eus, Redhat Enterprise Linux for Ibm Z Systems, Redhat Enterprise Linux for Ibm Z Systems Eus, Redhat Enterprise Linux for Power Little Endian, Redhat Enterprise Linux for Power Little Endian Eus, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server for Power Little Endian Update Services for Sap Solutions, Redhat Enterprise Linux Update Services for Sap Solutions, Samba Rsync, Suse Suse Linux, Tritondatacenter Smartos.

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

Apply the vendor's patch.

## Is CVE-2024-12087 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-12087 exists.

## Other vulnerabilities in Gentoo Linux

- [CVE-2024-12084](https://insights.sbomify.com/CVE-2024-12084/): Rsync: heap buffer overflow in rsync due to improper checksum length handling (critical 9.8)
- [CVE-2024-6387](https://insights.sbomify.com/CVE-2024-6387/): Openssh: regresshion - race condition in ssh allows rce/dos (high 8.1)
- [CVE-2024-12085](https://insights.sbomify.com/CVE-2024-12085/): Rsync: info leak via uninitialized stack contents (high 7.5)
- [CVE-2024-12088](https://insights.sbomify.com/CVE-2024-12088/): Rsync: --safe-links option bypass leads to path traversal (medium 6.5)
- [CVE-2024-12086](https://insights.sbomify.com/CVE-2024-12086/): Rsync: rsync server leaks arbitrary client files (medium 6.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-12087 is a medium-severity path traversal vulnerability in Gentoo Linux, published on 14 Jan 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-12087 exists.

Affected product: Gentoo Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-12087/ (Markdown: https://insights.sbomify.com/CVE-2024-12087/index.md)
```

## Sources

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

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