Bug 2211348 (CVE-2023-2728)

Summary: CVE-2023-2728 kube-apiserver: Bypassing enforce mountable secrets policy imposed by the ServiceAccount admission plugin
Product: [Other] Security Response Reporter: Avinash Hanwate <ahanwate>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: askrabec, dfreiber, dhellmann, jburrell, joelsmith, rogbas, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kube-apiserver 1.27.3, kube-apiserver 1.26.6, kube-apiserver 1.25.11, kube-apiserver 1.24.15 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in Kubernetes, where users may be able to launch containers that bypass the mountable secrets policy enforced by the ServiceAccount admission plugin when using ephemeral containers. The policy ensures that 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 ephemeral containers.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2215201, 2215203    
Bug Blocks: 2209134    

Description Avinash Hanwate 2023-05-31 07:55:20 UTC
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 ephemeral containers. 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 ephemeral containers.

This issue affects kube-apiserver. Clusters are impacted by this vulnerability if: 

   1. The ServiceAccount admission plugin is used. Most clusters should have this on by default as recommended in 
      https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#serviceaccount
   2. The *kubernetes.io/enforce-mountable-secrets* annotation is used by a service account. This annotation is not added by default. 
   3. Pods using ephemeral containers.

Comment 3 Avinash Hanwate 2023-06-15 05:43:52 UTC
Created golang-k8s-kubernetes tracking bugs for this issue:

Affects: fedora-all [bug 2215201]


Created origin tracking bugs for this issue:

Affects: fedora-all [bug 2215203]

Comment 6 errata-xmlrpc 2023-10-31 14:20:08 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.14

Via RHSA-2023:5008 https://access.redhat.com/errata/RHSA-2023:5008