CVE-2021-41149
📋 TL;DR
CVE-2021-41149 is a path traversal vulnerability in the Tough TUF library that allows attackers to overwrite arbitrary files on the system when caching repositories or saving targets. This affects all users of Tough library versions before 0.12.0 who cache repositories or save specific targets to output directories.
💻 Affected Systems
- tough (Rust TUF library)
📦 What is this software?
Tough by Amazon
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise via arbitrary file overwrite, potentially leading to remote code execution, data destruction, or privilege escalation.
Likely Case
Data corruption, denial of service, or unauthorized file modification in TUF repository operations.
If Mitigated
Limited impact with proper file permissions and sandboxing, but still potential for data integrity issues.
🎯 Exploit Status
Exploitation requires control over TUF repository content or ability to influence target names.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.12.0
Vendor Advisory: https://github.com/awslabs/tough/security/advisories/GHSA-x3r5-q6mj-m485
Restart Required: No
Instructions:
1. Update Cargo.toml to specify 'tough = "^0.12.0"' 2. Run 'cargo update' 3. Rebuild and redeploy applications using the library
🔧 Temporary Workarounds
No known workarounds
allThe advisory states no workarounds are available for this vulnerability
🧯 If You Can't Patch
- Restrict file system permissions for the application using tough library
- Run application in containerized/sandboxed environment with restricted file system access
🔍 How to Verify
Check if Vulnerable:
Check Cargo.lock or Cargo.toml for tough dependency version below 0.12.0
Check Version:
grep -A2 -B2 'tough' Cargo.lock || grep 'tough' Cargo.toml
Verify Fix Applied:
Verify tough version is 0.12.0 or higher in Cargo.lock
📡 Detection & Monitoring
Log Indicators:
- Unexpected file write operations outside expected directories
- Path traversal patterns in file operations
Network Indicators:
- Connections to untrusted TUF repositories
- Unusual repository fetch patterns
SIEM Query:
File creation events with path traversal patterns (../) from tough-related processes
🔗 References
- https://github.com/awslabs/tough/commit/1809b9bd1106d78a51fbea3071aa97a3530bac9a
- https://github.com/awslabs/tough/security/advisories/GHSA-x3r5-q6mj-m485
- https://github.com/awslabs/tough/commit/1809b9bd1106d78a51fbea3071aa97a3530bac9a
- https://github.com/awslabs/tough/security/advisories/GHSA-x3r5-q6mj-m485