-
Notifications
You must be signed in to change notification settings - Fork 40.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CVE-2021-25741: Symlink Exchange Can Allow Host Filesystem Access #104980
Comments
@cjcullen: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hey, is this issue still open? I would like to work on this, I am new to open source |
This comment has been minimized.
This comment has been minimized.
@pacoxu: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This comment has been minimized.
This comment has been minimized.
I'm curious, was the fix for CVE-2017-1002101 incomplete ? (#60813 / https://kubernetes.io/blog/2018/04/04/fixing-subpath-volume-vulnerability/) |
Are there any notes regarding how to exploit this vulnerability, or is that embargoed until a fix is available? |
Does the vulnerability still exists when using the "subPathExpr" field of container spec or just with the "subPath" field? |
Since v1.19.15 has already released. But I couldn't find which commit fix this issue: https://github.com/kubernetes/kubernetes/commits/v1.19.15 |
Fix is here #104253
so all the effort made to use |
Hello @champtar, reading in your comment i am still not sure if this is not fixed by CVE-2017-1002101 which you already mentioned above,
Did someone verify this CVE is exploitable? |
Fix for CVE-2017-1002101 creates a safe path using /proc/x/fd/y trick and pass this safe magic symlink to the mount binary that resolves (canonicalize) the link before passing it to the mount syscall, allowing the race condition again. What was missed in 2017 (and that's easy to miss) is the util-linux mount default behavior, if k8s was using mount syscall directly the fix would have been good. |
I couldn't really exploit it due to patching of CVE-2017-1002101 , if exploit is confirmed then it can be me not doing it properly! |
/label official-cve-feed (Related to kubernetes/sig-security#1) |
how do we update to fix version? For example, I'm getting CVE-2021-25741 Security Vulnerability, the suggested fix version is : what commands do I run? Is it something like the below:
or I tied both, and the error says 'unknown revision 1.22.1' |
@mmeekah you can just |
Fix CVE-2021-25741: Pass additional flags to subpath mount to avoid flakes in certain conditions **MR 描述 / 目的**: **关联 issue**: Fixes CVE-2021-25741: kubernetes#104980 **代码审查须知**: **MR 是否对用户有影响?**: ```发布须知 ```
A security issue was discovered in Kubernetes where a user may be able to create a container with subpath volume mounts to access files & directories outside of the volume, including on the host filesystem.
This issue has been rated High (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), and assigned CVE-2021-25741.
Affected Components and Configurations
This bug affects kubelet.
Environments where cluster administrators have restricted the ability to create hostPath mounts are the most seriously affected. Exploitation allows hostPath-like access without use of the hostPath feature, thus bypassing the restriction.
In a default Kubernetes environment, exploitation could be used to obscure misuse of already-granted privileges.
Affected Versions
v1.22.0 - v1.22.1
v1.21.0 - v1.21.4
v1.20.0 - v1.20.10
<= v1.19.14
Fixed Versions
This issue is fixed in the following versions:
v1.22.2
v1.21.5
v1.20.11
v1.19.15
Mitigation
To mitigate this vulnerability without upgrading kubelet, you can disable the VolumeSubpath feature gate on kubelet and kube-apiserver, and remove any existing Pods making use of the feature.
You can also use admission control to prevent less-trusted users from running containers as root to reduce the impact of successful exploitation.
Detection
If you find evidence that this vulnerability has been exploited, please contact security@kubernetes.io
Additional Details
See Kubernetes Issue #104980 for more details.
Acknowledgements
This vulnerability was reported by Fabricio Voznika and Mark Wolters of Google.
Thanks as well to Ian Coldwater, Duffie Cooley, Brad Geesaman, and Rory McCune for the thorough security research that led to the discovery of this vulnerability.
The text was updated successfully, but these errors were encountered: