Kubetier
← Permission Reference
T2

patch storageclasses

Patching a StorageClass cannot change its immutable fields (provisioner, parameters, reclaimPolicy, volumeBindingMode), but moving the default-class annotation between existing classes redirects every unclassed PersistentVolumeClaim cluster-wide to an attacker-chosen class.

API Group
storage.k8s.io
Scope
cluster
Audit Level
Request

Escalation Paths

  1. Create a StorageClass, or patch an existing one, and set the storageclass.kubernetes.io/is-default-class annotation to make it the cluster default

  2. The API server allows more than one default class, and the DefaultStorageClass plugin breaks the tie by newest creationTimestamp, so a freshly created default wins without touching the existing one

  3. With reclaimPolicy Retain on that class, the provisioned volume and its data survive deletion of the requesting namespace

  4. Every PersistentVolumeClaim that omits storageClassName then binds through the attacker class.

    Patch alone also suffices, since it moves the annotation between existing classes with no create

Additional rights needed:

none
K8s docs ↗
K8s docs ↗