Privilege escalation with rsync is not theory. It’s a precise chain of events where misconfiguration turns a common file transfer tool into a weapon. Rsync’s power comes from its ability to preserve file permissions, ownerships, and even special bits like setuid when run with elevated rights. In compromised environments, that power cuts both ways.
Attackers exploit rsync by pairing it with incorrect ACLs, group memberships, or root-owned directories exposed to non-privileged accounts. The most dangerous case is when rsync is run by a privileged user—manually or via automated scripts—and handles files from untrusted sources. A single copy operation can inject binaries with escalated permissions into sensitive paths.
Typical scenarios include:
rsyncrunning in cron jobs under root without strict path validation.- Open rsync daemons without authentication, allowing arbitrary file writes.
- Misuse of
--permsor--ownerflags, resulting in transferred files inheriting elevated privileges.
Mitigation is blunt but effective.