AWS's Log4Shell Hot Patch Vulnerable to Container Escape and Privilege Escalation
AWS's Log4Shell hot patch solutions invoked container binaries named 'java' without proper container isolation, running them with full capabilities and as root. A malicious container could exploit this to escape and take over the host, and an unprivileged process could escalate to root.
Published on unit42.paloaltonetworks.com
Following Log4Shell, AWS released several hot patch solutions that monitor for vulnerable Java applications and Java containers and patch them on the fly. Each solution suits a different environment, covering standalone servers, Kubernetes clusters, Elastic Container Service (ECS) clusters and Fargate.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The hot patch solutions invoked container binaries without properly containerizing them, running them with full Linux capabilities, as root, and without seccomp or cgroups isolation.
Impact
A malicious container could escape and gain root code execution on the underlying host, and an unprivileged process could escalate privileges to root; this affected even containers using user namespaces or non-root users.
What the attacker needed
Hot patch installed on host or cluster; ability to run a container or process
The fix
AWS released fixed versions of the hot patch package, Daemonset, and Hotdog that properly containerize container binaries and spawn 'java' with the same privileges as the process being patched.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Containers are meant to keep programs separate from the rest of the computer, like a sandbox. AWS made a tool to fix a serious Java bug, but that tool ran programs from inside containers with too much power. So a bad container could break out of its sandbox and control the whole machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.