On Tuesday, six rsync vulnerabilities were made public. The most serious one, CVE-2024-12084, is a heap overflow in the rsync daemon which, according to the oss-security announcement, allows remote code execution together with an information leak (CVE-2024-12085) – even for a user who only has anonymous read access, as on a public mirror server. The other bugs mainly affect the rsync client: a malicious server can read files from the client, or write outside the destination directory.
rsync is on almost every Linux server, behind backups, deployments and synchronisation. The good news is that the fixes are already out in the upstream release and in the major distributions. Here is a summary of what you need to know, and what is worth doing today.
What happened?
The bugs were made public on 14 January on the oss-security mailing list, and rsync 3.4.0, containing the fixes, was released the same day. Five of the bugs were found by researchers from Google Cloud Vulnerability Research (Simon Scannell, Pedro Gallegos and Jasiel Spelman), and one by Aleksei Gorban. 3.4.0 brought a few regressions (for example, the -H option, which preserves hard links, worked incorrectly), and these are fixed in 3.4.1, released on 15 January.
| CVE | CVSS | Bug | Who is at risk? |
|---|---|---|---|
| CVE-2024-12084 | 9.8 | Heap overflow in the handling of the checksum length (3.2.7 – 3.3.0) | rsync daemon |
| CVE-2024-12085 | 7.5 | Leak of uninitialised stack memory, byte by byte | rsync daemon |
| CVE-2024-12086 | 6.1 | The server can read arbitrary files from the client | Client, when connecting to a malicious server |
| CVE-2024-12087 | 6.5 | Path traversal because of --inc-recursive |
Client, when connecting to a malicious server |
| CVE-2024-12088 | 6.5 | Bypass of --safe-links, writing outside the destination directory |
Client, when connecting to a malicious server |
| CVE-2024-12747 | 5.6 | Race condition in the handling of symbolic links | Local attacker, when rsync runs with high privileges |
The CVSS scores are Red Hat’s ratings. CVE-2024-12084 only affects versions 3.2.7 and later; the other bugs affect every version before 3.4.0.
According to press reports, Shodan shows roughly 660,000 rsync servers reachable from the internet, the vast majority of them in China. Not all of them are vulnerable, but the attack surface is large.
Who is affected by the rsync vulnerability?
Those running an rsync daemon (TCP 873) are affected the most. If rsync --daemon is running on the machine and port 873 is reachable, CVE-2024-12084 and -12085 are the most important. The worst case is an anonymous, readable module – typically mirror servers and public download sites, but also backup modules left without a password “for convenience” on an internal network.
Those using rsync over SSH are affected by the client-side bugs (-12086, -12087, -12088) if the other side isn’t trusted. Here it’s worth thinking about the direction: if the backup server itself pulls the data from the machines, a compromised machine can act as a “malicious server” towards the backup server, and through these bugs it can write outside the destination directory or read files from the backup server. In other words, a compromised machine can be used to attack the backup server.
CVE-2024-12747 is a local bug: it matters where rsync runs as root on directories that other users can also write to.
How to check
rsync --version | head -1
ss -tlnp | grep ':873'
systemctl status rsync # Debian, Ubuntu
systemctl status rsyncd # RHEL family (rsync-daemon package)
The distributions backport the fixes into their own version, so don’t look for the upstream version number but for the package version:
dpkg -l rsync # Debian, Ubuntu
rpm -q rsync # RHEL, AlmaLinux, Rocky Linux
You can find the daemon’s module settings in the /etc/rsyncd.conf file; check whether there is a module without an auth users line.
Where the distributions stand
| Distribution | Advisory | Fixed package |
|---|---|---|
| Debian 12 | DSA-5843-1 (14 Jan), DSA-5843-2 (16 Jan, -H regression) |
3.2.7-1+deb12u2 |
| Ubuntu 24.04 LTS | USN-7206-1 (14 Jan), USN-7206-2 (16 Jan, regression) | 3.2.7-1ubuntu1.2 |
| Ubuntu 22.04 LTS | USN-7206-1, USN-7206-2 | 3.2.7-0ubuntu0.22.04.4 |
| Ubuntu 20.04 LTS | USN-7206-1, USN-7206-2 | updated |
| RHEL 9 | RHSA-2025:0324 (15 Jan) | rsync-3.2.3-20.el9_5.1 |
| RHEL 8 | RHSA-2025:0325 (15 Jan) | rsync-3.1.3-20.el8_10 |
RHEL 8 and 9 ship an older rsync version, so the most serious bug, CVE-2024-12084, doesn’t affect them; Red Hat’s January updates fix CVE-2024-12085. Proxmox VE 8 is based on Debian 12, so it gets the updated Debian package. If you have already installed the first Debian or Ubuntu fix and you sync with the -H option, make sure you update to the second-round package.
CentOS 7, which went out of support in mid-2024, gets no fix. Ubuntu 20.04 still does, but its standard support expires on 31 May – we wrote about this in our EOL list for 2025.
After the update, restart the running rsync daemon, otherwise the old code keeps running.
How to protect the rsync daemon
Updating is the first step, but a well-configured daemon will also be less exposed to the next bug:
- Don’t make it public unless you have to. Port 873 should only be reachable from the internal network or from a few specified addresses; restrict the modules with the
hosts allowsetting too. - Require a password for every module (
auth usersandsecrets file), except for deliberately public mirrors. - A module meant for reading should be
read only = yes, and the daemon shouldn’t write as root (uid,gid). use chroot = yes, so that the module can’t step outside its own directory.- Where possible, use SSH instead of the rsync daemon. rsync over SSH doesn’t need a separate open port, SSH handles authentication, and with a restricted key (for example, with the
rrsyncscript that comes with rsync) it can be limited to a single directory.
For example, a stricter module:
[backup]
path = /srv/backup
read only = yes
use chroot = yes
uid = backup
gid = backup
auth users = backup
secrets file = /etc/rsyncd.secrets
hosts allow = 10.10.0.0/24
And on the backup server, it’s worth reviewing the pull direction: if the source machines push the data into a low-privileged account, a compromised source machine can do less harm.
The lesson
rsync is one of those tools nobody thinks about while it works. Last year the xz backdoor showed that a quiet base package that is present everywhere can also be a serious risk; now six bugs have turned up in a tool that has been in use for decades. In situations like this, what counts is how long it takes to find out where the affected software is running at all, and how long it takes for the update to reach every machine.
If you run a mirror server, backup infrastructure or a hosting provider environment and you need help with reviewing or updating it, get in touch; you can read about our operations services for providers on the For hosting providers page.