Container Escape on Aws

How Container Escape Manifests in Aws

Container escape in Aws environments typically exploits the intersection between container runtime vulnerabilities and Aws's unique container orchestration features. The most common Aws-specific attack vector involves leveraging Aws Fargate's container isolation model, where attackers exploit misconfigured task roles or IAM permissions to escalate privileges beyond the container boundary.

A critical Aws-specific pattern occurs when containers running on EKS (Elastic Kubernetes Service) or ECS (Elastic Container Service) are granted overly permissive IAM roles. An attacker who gains code execution within the container can use the Aws metadata service at http://169.254.169.254 to retrieve credentials for the container's assigned role. This metadata endpoint is accessible from within any container running on EC2 or Fargate, making it a universal attack surface.

Consider this vulnerable Aws-specific code pattern: