Overly Permissive Kubernetes RBAC

Kubernetes roles grant users, groups or service accounts more access than they need, such as wildcard rights or permissions that allow escalation to cluster administrator.

SeverityHigh
CVSS 3.18.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Open in the calculator
CVSS 4.08.7 CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator
CWECWE-266: Incorrect Privilege Assignment
OWASP Top 10A06:2025 Insecure Design
MITRE ATT&CKT1098.006 Additional Container Cluster Roles, T1610 Deploy Container, T1552.007 Container API
CategoryBroken Access Control

Description

Kubernetes role-based access control (RBAC) grants permissions through Roles and ClusterRoles, which RoleBindings and ClusterRoleBindings attach to users, groups and service accounts. The weakness arises when these grants are broader than the subject needs, for example cluster-admin bound to application service accounts or to broad groups such as system:authenticated, or roles that use the * wildcard for verbs or resources.

Several permissions amount to, or lead quickly to, full control even when they look narrow: listing or reading Secrets across the cluster; creating pods or workload resources, which allows a pod to run as any service account in the namespace and, without Pod Security Admission, to run privileged; the escalate, bind and impersonate verbs; the nodes/proxy subresource; creating service account tokens; approving certificate signing requests; and changing admission webhooks. Membership of the system:masters group bypasses RBAC entirely.

An attacker who obtains the credentials of an over-privileged identity, such as a service account token taken from a compromised pod or a leaked CI/CD credential, gains its permissions and, depending on the grant, can read every Secret in the cluster, run code in other workloads, create privileged pods that take over nodes or grant themselves cluster administrator rights. From there they can reach any cloud or external system whose credentials the cluster holds.

Excessive permissions are identified by reviewing roles and bindings, by testing what each identity can do with kubectl auth can-i --list and its --as option, and with RBAC analysis tools that flag risky permissions and escalation paths.

Remediation

  • Inventory all bindings, for example with kubectl get clusterrolebindings,rolebindings -A -o wide, and remove those that are not needed, starting with cluster-admin and wildcard grants.
  • Give each workload its own service account with a namespaced Role that lists only the resources and verbs it uses, and avoid ClusterRoleBindings for application identities.
  • Restrict the high-risk permissions listed above to a small number of administrative identities, and do not add users to system:masters.
  • Use groups from an external identity provider with short-lived credentials for human access, and review bindings regularly and whenever staff change roles.
  • Enforce Pod Security Admission so that permission to create pods does not imply control of nodes.
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: read-app-settings namespace: app rules: - apiGroups: [""] resources: ["configmaps"] resourceNames: ["app-settings"] verbs: ["get"]

Confirm the fix by repeating kubectl auth can-i --list for the affected identities and checking that only the intended permissions remain.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Containers and Kubernetes Findings

Every Containers and Kubernetes finding