CVE-2021-33497
📋 TL;DR
This vulnerability allows attackers to delete arbitrary files on the server through directory traversal in the file deletion functionality of transfer.sh. It affects all users running transfer.sh versions before 1.2.4. Attackers can exploit this to delete critical system files or application data.
💻 Affected Systems
- dutchcoders transfer.sh
📦 What is this software?
Transfer.sh by Dutchcoders
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise through deletion of critical system files (like /etc/passwd, SSH keys, or application configuration files), leading to service disruption, data loss, or privilege escalation.
Likely Case
Unauthorized deletion of application files, user uploads, or configuration files causing service disruption and data loss for the transfer.sh service.
If Mitigated
Limited impact to non-critical files if proper file permissions and isolation are implemented, though service disruption is still possible.
🎯 Exploit Status
The vulnerability is in the file deletion endpoint and requires minimal technical skill to exploit. Public proof-of-concept details are available in the advisory.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.2.4
Vendor Advisory: https://github.com/dutchcoders/transfer.sh/releases/tag/v1.2.4
Restart Required: Yes
Instructions:
1. Stop the transfer.sh service. 2. Update to version 1.2.4 or later using 'go get github.com/dutchcoders/transfer.sh' or download the release. 3. Rebuild and restart the service.
🔧 Temporary Workarounds
Disable file deletion functionality
allRemove or disable the file deletion endpoint entirely if not required
Modify server configuration to disable DELETE endpoints
Comment out deletion routes in source code
Implement strict file path validation
allAdd input validation to prevent directory traversal in file paths
Implement path sanitization before file operations
Use absolute path resolution with boundary checks
🧯 If You Can't Patch
- Implement network-level controls to restrict access to the deletion endpoint
- Deploy the service in a container with read-only filesystem for critical directories
🔍 How to Verify
Check if Vulnerable:
Check if running transfer.sh version is below 1.2.4 using the version flag or by examining the binary
Check Version:
./transfer.sh --version or check the binary/build information
Verify Fix Applied:
Confirm version is 1.2.4 or higher and test deletion functionality with traversal attempts
📡 Detection & Monitoring
Log Indicators:
- Multiple failed file deletion attempts with unusual paths
- DELETE requests containing '../' sequences
- File deletion errors for non-existent paths outside expected directories
Network Indicators:
- HTTP DELETE requests with path traversal sequences
- Unusual patterns of file deletion requests
SIEM Query:
method=DELETE AND (uri CONTAINS "../" OR uri CONTAINS "..\")
🔗 References
- https://github.com/dutchcoders/transfer.sh/pull/373
- https://github.com/dutchcoders/transfer.sh/releases/tag/v1.2.4
- https://github.com/dutchcoders/transfer.sh/releases/tag/v1.2.4
- https://vuln.ryotak.me/advisories/44
- https://github.com/dutchcoders/transfer.sh/pull/373
- https://github.com/dutchcoders/transfer.sh/releases/tag/v1.2.4
- https://github.com/dutchcoders/transfer.sh/releases/tag/v1.2.4
- https://vuln.ryotak.me/advisories/44