Overview

FieldValue
ID1037
NameManage StatefulSets cluster-wide
Risk CategoryElevation of Privilege
Risk LevelCritical
Role TypeClusterRole
API Groupsapps
Resourcesstatefulsets
Verbscreate, update, patch, delete
TagsPersistence PrivilegeEscalation Tampering WorkloadLifecycle

Description

Grants permission to create, update, or delete StatefulSets across all namespaces. Similar to Deployments, this can be used to deploy pods (often stateful applications) with privileged configurations, leading to privilege escalation, persistence, and tampering.

Abuse Scenarios

  1. Create a new StatefulSet with a privileged pod template.
kubectl create -n <namespace> -f - <<EOF
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: privileged-statefulset
spec:
  serviceName: "privileged-service"
  replicas: 1
  selector:
    matchLabels:
      app: privileged-sts
  template:
    metadata:
      labels:
        app: privileged-sts
    spec:
      containers:
      - name: attacker
        image: busybox
        command: ["/bin/sh", "-c", "sleep infinity"]
        securityContext:
          privileged: true
EOF
# Example: kubectl create -n default -f - <<EOF ... EOF
  1. Scale a critical StatefulSet to zero replicas, causing data inconsistency or DoS.
kubectl scale statefulset <statefulset-name> -n <namespace> --replicas=0
# Example: kubectl scale statefulset my-database -n production --replicas=0