Giveback
Summary
I found a WordPress site on a Kubernetes-hosted server running an outdated Give donation plugin. An unauthenticated object-deserialization flaw in the plugin gave code execution inside the WordPress container. An environment variable in that container pointed to an internal legacy CMS.
That CMS used a vulnerable PHP-CGI configuration, which gave root inside a second container and access to its Kubernetes service-account token. The token read cluster secrets, which exposed a reusable password for the host user babywyrm. Over SSH, that user could run a runc-based debug wrapper through sudo.
The wrapper's runc 1.1.11 had a file-descriptor leak that allowed a container escape to host root. Full host compromise followed.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export INTERNAL_HOST="<another-host-reached-after-pivoting>"Attack path — how the box was taken
FixPatch the Give plugin and restrict WordPress information disclosureCritical
FixSegment internal services with Kubernetes NetworkPoliciesHigh
FixRetire or patch the legacy PHP-CGI CMS and run it unprivilegedCritical
FixLimit service-account permissions and stop storing host passwords in cluster secretsCritical
FixUpgrade runc and remove the sudo-permitted runc wrapperCritical
Exposed services
| 22/tcp | ssh recon-sweep-discovered |
| 80/tcp | http recon-sweep-discovered |
| 30686/tcp | unknown recon-sweep-discovered |