CVE-2017-1002102 - atomic writer volume handling allows arbitrary file deletion in host filesystem #60814
Description
CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H
This vulnerability allows containers using a secret, configMap, projected or downwardAPI volume to trigger deletion of arbitrary files and directories on the nodes where they are running.
Thanks to Joel Smith of Red Hat for reporting this problem.
Vulnerable versions:
- Kubernetes 1.3.x-1.6.x
- Kubernetes 1.7.0-1.7.13
- Kubernetes 1.8.0-1.8.8
- Kubernetes 1.9.0-1.9.3
Vulnerable configurations:
- Clusters that run untrusted containers with secret, configMap, downwardAPI or projected volumes mounted (including auto-added service account token mounts).
Vulnerability impact:
A malicious container running in a pod with a secret, configMap, downwardAPI or projected volume mounted (including auto-added service account token mounts) can cause the Kubelet to remove any file or directory on the host filesystem.
Mitigations prior to upgrading:
Do not allow containers to be run with secret, configMap, downwardAPI and projected volumes (note that this prevents use of service account tokens in pods, and requires use of automountServiceAccountToken: false
)
Fixed versions:
- Fixed in v1.7.14 by [1.7] Automated cherry pick of #58720 #60342 #60516
- Fixed in v1.8.9 by [1.8] Automated cherry pick of #58720 #57326 #60342 #60515
- Fixed in v1.9.4 by [1.9] Automated cherry pick of #58720 #57326 #60342 #60258
- Fixed in master by Ensure that the runtime mounts RO volumes read-only #58720 (included in v1.10.0-beta.1 and up, will be in v1.10.0)
Fix impact:
Secret, configMap, downwardAPI and projected volumes will be mounted as read-only volumes. Applications that attempt to write to these volumes will receive read-only filesystem errors. Previously, applications were allowed to make changes to these volumes, but those changes were reverted at an arbitrary interval by the system. Applications should be re-configured to write derived files to another location.