CVE-2017-8805
📋 TL;DR
This vulnerability in Debian's ftpsync tool allows remote attackers to perform directory traversal attacks when syncing from malicious upstream mirrors. Attackers can write files outside the intended directory structure, potentially compromising the mirror server. This affects Debian systems using ftpsync for mirror synchronization.
💻 Affected Systems
- Debian ftpsync
📦 What is this software?
Ftpsync by Debian
⚠️ Risk & Real-World Impact
Worst Case
Complete compromise of the mirror server through arbitrary file writes, potentially leading to remote code execution, data theft, or server takeover.
Likely Case
Unauthorized file writes to sensitive directories, potentially enabling privilege escalation or persistence mechanisms.
If Mitigated
Limited to file writes within controlled directories if proper access controls and monitoring are in place.
🎯 Exploit Status
Exploitation requires controlling or compromising an upstream mirror that the vulnerable ftpsync connects to.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 20171017 and later
Vendor Advisory: https://lists.debian.org/debian-mirrors/2017/10/msg00017.html
Restart Required: No
Instructions:
1. Update ftpsync package to version 20171017 or later. 2. For Debian systems: 'apt-get update && apt-get install ftpsync'. 3. Verify the fix by checking the version.
🔧 Temporary Workarounds
Manual rsync with --safe-links
linuxManually run rsync with the --safe-links option instead of using vulnerable ftpsync
rsync --safe-links [other options] source destination
Network segmentation
allRestrict ftpsync to only connect to trusted upstream mirrors
🧯 If You Can't Patch
- Implement strict network controls to only allow ftpsync connections to verified trusted mirrors
- Monitor file system changes in directories where ftpsync writes and implement file integrity monitoring
🔍 How to Verify
Check if Vulnerable:
Check ftpsync version: 'dpkg -l ftpsync' or check if rsync is called without --safe-links in ftpsync scripts
Check Version:
dpkg -l ftpsync | grep ftpsync
Verify Fix Applied:
Verify ftpsync version is 20171017 or later and that rsync commands include --safe-links option
📡 Detection & Monitoring
Log Indicators:
- Unusual file writes outside expected mirror directories
- Rsync operations without --safe-links flag
Network Indicators:
- Rsync connections to untrusted or unknown mirrors
SIEM Query:
source="syslog" AND "rsync" AND NOT "--safe-links"
🔗 References
- http://www.openwall.com/lists/oss-security/2017/10/17/2
- https://anonscm.debian.org/cgit/mirror/archvsync.git/commit/?id=d1ca2ab2210990b6dfb664cd6776a41b71c48016
- https://lists.debian.org/debian-mirrors/2017/10/msg00017.html
- http://www.openwall.com/lists/oss-security/2017/10/17/2
- https://anonscm.debian.org/cgit/mirror/archvsync.git/commit/?id=d1ca2ab2210990b6dfb664cd6776a41b71c48016
- https://lists.debian.org/debian-mirrors/2017/10/msg00017.html