CVE-2020-8570
📋 TL;DR
CVE-2020-8570 is a path traversal vulnerability in Kubernetes Java client libraries that allows attackers to write files outside the intended directory when copying files from a remote pod. This can lead to arbitrary file overwrites on the system running the vulnerable client code. Affected users include anyone using Kubernetes Java client libraries for file operations from remote pods.
💻 Affected Systems
- Kubernetes Java Client Libraries
📦 What is this software?
Java by Kubernetes
Java by Kubernetes
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise through arbitrary file overwrites, potentially leading to remote code execution, data destruction, or privilege escalation.
Likely Case
Unauthorized file modifications, configuration tampering, or denial of service through critical file corruption.
If Mitigated
Limited impact if proper file permissions and container isolation prevent writes to sensitive locations.
🎯 Exploit Status
Exploitation requires ability to create or control a pod that can send malicious archives. The vulnerability is well-documented with public proof-of-concept available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Version 9.0.1 and later, or version 10.0.1 and later
Vendor Advisory: https://groups.google.com/g/kubernetes-security-announce/c/sd5h73sFPrg
Restart Required: Yes
Instructions:
1. Update Kubernetes Java client library to version 9.0.1 or later (for 9.x branch) or 10.0.1 or later (for 10.x branch). 2. Update pom.xml or build.gradle dependencies. 3. Rebuild and redeploy affected applications. 4. Restart any running services using the updated libraries.
🔧 Temporary Workarounds
Disable file copy from untrusted pods
allAvoid using copy functionality from remote pods that you don't fully trust.
# Review application code and remove or restrict copy operations from pods
# Implement pod validation before allowing copy operations
Implement file path validation
allAdd custom validation to ensure copied files stay within safe directories.
# Implement path canonicalization and validation in copy operations
# Use java.nio.file.Path methods to validate paths before writing
🧯 If You Can't Patch
- Implement strict pod admission controls to prevent untrusted pods from being created
- Run client applications with minimal file system permissions and in isolated containers
🔍 How to Verify
Check if Vulnerable:
Check your project's dependency management file (pom.xml or build.gradle) for kubernetes-client version. If version is 10.0.0 or any version below 9.0.1, you are vulnerable.
Check Version:
mvn dependency:tree | grep kubernetes-client OR gradle dependencies | grep kubernetes-client
Verify Fix Applied:
After updating, verify the kubernetes-client version is 9.0.1+ or 10.0.1+ in your dependency management file and rebuilt application.
📡 Detection & Monitoring
Log Indicators:
- Unexpected file write operations outside expected directories
- Errors from file copy operations with path traversal patterns
- Multiple failed file write attempts to system directories
Network Indicators:
- Unusual pod creation followed by file copy operations
- Large archive transfers from pods to client applications
SIEM Query:
source="kubernetes" AND (operation="copy" OR operation="exec") AND (path="../" OR path="..\\" OR path contains "../")
🔗 References
- https://github.com/kubernetes-client/java/issues/1491
- https://groups.google.com/g/kubernetes-security-announce/c/sd5h73sFPrg
- https://lists.apache.org/thread.html/r0c76b3d0be348f788cd947054141de0229af00c540564711e828fd40%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/r1975078e44d96f2a199aa90aa874b57a202eaf7f25f2fde6d1c44942%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/rcafa485d63550657f068775801aeb706b7a07140a8ebbdef822b3bb3%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/rdb223e1b82e3d7d8e4eaddce8dd1ab87252e3935cc41c859f49767b6%40%3Ccommits.druid.apache.org%3E
- https://github.com/kubernetes-client/java/issues/1491
- https://groups.google.com/g/kubernetes-security-announce/c/sd5h73sFPrg
- https://lists.apache.org/thread.html/r0c76b3d0be348f788cd947054141de0229af00c540564711e828fd40%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/r1975078e44d96f2a199aa90aa874b57a202eaf7f25f2fde6d1c44942%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/rcafa485d63550657f068775801aeb706b7a07140a8ebbdef822b3bb3%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/rdb223e1b82e3d7d8e4eaddce8dd1ab87252e3935cc41c859f49767b6%40%3Ccommits.druid.apache.org%3E