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
Create a StorageClass, or patch an existing one, and set the storageclass.kubernetes.io/is-default-class annotation to make it the cluster default
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
With reclaimPolicy Retain on that class, the provisioned volume and its data survive deletion of the requesting namespace
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:
