REDHAT-BUG-2515419: Race Condition
rsync before 3.5.0 contains a time-of-check to time-of-use (TOCTOU) race condition vulnerability in the rrsync restricted shell wrapper that allows authenticated clients to escape enforced directory restrictions by substituting a symlink for a path component after validation but before transfer processing. Attackers can additionally leverage unrestricted flags such as --copy-unsafe-links, -D, and --log-file through rrsync to read or write files outside the permitted directory subtree.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rsyncto a version that resolves this vulnerability.Fixed in 3.5.0 - Configuration
Disable or restrict the unrestricted rrsync flags --copy-unsafe-links, -D, and --log-file to prevent reads or writes outside the permitted directory subtree.
rrsync --copy-unsafe-links, -D, --log-file = disabled
Event History
Frequently Asked Questions
Who is exposed to this issue?
Deployments that use the rrsync restricted shell wrapper and allow authenticated rsync clients to access a restricted directory subtree are exposed. The issue affects rsync versions before 3.5.0.
What does an attacker need to exploit the vulnerability?
An attacker needs authenticated access as an rsync client through rrsync. They must be able to substitute a symlink for a path component after rrsync validates the path and before transfer processing occurs.
What could an attacker do after exploiting it?
An attacker may escape the directory restrictions enforced by rrsync and read or write files outside the permitted subtree. Unrestricted options including --copy-unsafe-links, -D, and --log-file can also be leveraged through rrsync.
What should be prioritized for remediation?
Update rsync to version 3.5.0 or later. If immediate patching is not possible, prioritize systems where authenticated users can invoke rrsync and where writable paths could be used to replace path components with symlinks.