Repository navigation
committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)
sig/authCategorizes an issue or PR as relevant to SIG Auth.Categorizes an issue or PR as relevant to SIG Auth.
triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
CVSS Rating: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N - Low (2.7)
A security issue was discovered in Kubernetes where users may be able to launch containers that bypass the mountable secrets policy enforced by the ServiceAccount admission plugin when using containers, init containers, and ephemeral containers with the envFrom field populated. The policy ensures pods running with a service account may only reference secrets specified in the service account’s secrets field. Kubernetes clusters are only affected if the ServiceAccount admission plugin and the kubernetes.io/enforce-mountable-secrets annotation are used together with containers, init containers, and ephemeral containers with the envFrom field populated.
Am I vulnerable?
The ServiceAccount admission plugin is used. Most cluster should have this on by default as recommended in https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#serviceaccount
The kubernetes.io/enforce-mountable-secrets annotation is used by a service account. This annotation is not added by default. Pods using containers, init containers, and ephemeral containers with the envFrom field populated.
Affected Versions
kube-apiserver v1.29.0 - v1.29.3
kube-apiserver v1.28.0 - v1.28.8
kube-apiserver \<= v1.27.12
How do I mitigate this vulnerability?
This issue can be mitigated by applying the patch provided for the kube-apiserver component. The patch prevents containers, init containers, and ephemeral containers with the envFrom field populated from bypassing the mountable secrets policy enforced by the ServiceAccount admission plugin.
Outside of applying the provided patch, there are no known mitigations to this vulnerability.
Fixed Versions
- kube-apiserver master - fixed by Add envFrom to serviceaccount admission plugin #124322
- kube-apiserver v1.29.4 - fixed by Automated cherry pick of #124322: Add envFrom to serviceaccount admission plugin #124325
- kube-apiserver v1.28.9 - fixed by Automated cherry pick of #124322: Add envFrom to serviceaccount admission plugin #124326
- kube-apiserver v1.27.13 - fixed by Automated cherry pick of #124322: Add envFrom to serviceaccount admission plugin #124327
To upgrade, refer to the documentation:
https://kubernetes.io/docs/tasks/administer-cluster/cluster-upgrade/
Detection
Pod update requests using a container, init container, or ephemeral container with the envFrom field populated that exploits this vulnerability with unintended secret will be captured in API audit logs. You can also use the following kubectl command to find active pods using the kubernetes.io/enforce-mountable-secrets annotation.
kubectl get serviceaccounts --all-namespaces -o jsonpath="{range .items[?(@.metadata.annotations['kubernetes\.io/enforce-mountable-secrets']=='true')]}{.metadata.namespace}{'\t'}{.metadata.name}{'\n'}{end}"
If you find evidence that this vulnerability has been exploited, please contact security@kubernetes.io
Acknowledgements
This vulnerability was reported by tha3e1vl.
The issue was fixed and coordinated by the fix team:
Rita Zhang @ritazh
Joel Smith @joelsmith
Mo Khan @enj
and release managers:
Sascha Grunert @saschagrunert
Jeremy Rickard @jeremyrickard
/triage accepted
/lifecycle frozen
/area security
/kind bug
/committee security-response
Activity
- k8s-ci-robotadded lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.on Apr 16, 2024
-
ritazh commentedon Apr 16, 2024 MemberAuthorMore actions /label official-cve-feed
/area apiserver
/sig auth
Reacted by Icaro Lordes - k8s-ci-robotadded sig/authCategorizes an issue or PR as relevant to SIG Auth.Categorizes an issue or PR as relevant to SIG Auth.on Apr 16, 2024
- github-project-automationadded this to SIG Authon Apr 16, 2024
- k8s-ci-robotadded official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)on Apr 16, 2024
- github-project-automationmoved this to Needs Triage in SIG Authon Apr 16, 2024
- ritazhchanged the title ~~[-]PLACEHOLDER ISSUE[/-]~~ [+]CVE-2024-3177: Bypassing mountable secrets policy imposed by the ServiceAccount admission plugin[/+] on Apr 16, 2024
- ritazhclosed this as completedon Apr 18, 2024
- github-project-automationmoved this from Needs Triage to Closed / Done in SIG Authon Apr 18, 2024
- doanacadded a commit that references this issue on Jan 6, 2026
- jpuhlmanadded a commit that references this issue on Jan 20, 2026
Metadata
Metadata
Assignees
Labels
committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)
sig/authCategorizes an issue or PR as relevant to SIG Auth.Categorizes an issue or PR as relevant to SIG Auth.
triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Type
Projects
- StatusClosed / DoneShow more project fields