What the demonstration did
Replaying the ECScape demonstration / published August 2025; the run dates are not stated
- 1
Instance credentials from a low-privileged container
Not dated · published Aug 6, 2025The low-privileged container asks the instance metadata service for the instance profile credentials and receives the instance role.
- 2
Impersonating the ECS agent
Not dated · published Aug 6, 2025The instance role finds the agent's control channel, local endpoints give the identifiers, and a forged agent session receives every task's role credentials.
- 3
Using the stolen task roles
Not dated · published Aug 6, 2025A stolen task role with full S3 access deletes a demo bucket, and a stolen task execution role reads the demo secret db-secret.
- 4
Disclosure and AWS's response
July 2025 · day not statedSweet Security reports the issue to AWS, which calls it a design consideration of ECS on EC2 and updates its documentation.
From a low-privileged container on a shared ECS container instance, the researcher took the instance role credentials, impersonated the ECS agent and received the task role and task execution role credentials of the other tasks on the instance; with them, a demo S3 bucket was deleted and a demo secret was read. Direct assumption of the task roles failed, and Fargate tasks are not affected. AWS classified the behavior as a design consideration and updated its documentation.
What the demonstration shows about your ECS on EC2 instances
The chain needed one low-privileged container that could reach the instance metadata service. Once it held the instance role, no AWS control told its agent session from the real agent's, and the control plane sent it the credentials of every task with a role on the instance. The controls that cap it sit before and after that point: keep your tasks off the instance metadata service with the ECS agent setting for awsvpc tasks and IMDSv2 with a hop limit of 1 for bridge tasks, and bound what a stolen task role can do with service control policies and S3 Object Lock. Fargate tasks are not affected. AWS treats the behavior as a design consideration of ECS on EC2, so separating tasks of different privilege is yours to do.
Would the controls have stopped it?
In hindsight, no control would have stopped it. 6 controls would have limited how far it went. 5 steps have no cloud-provider control. The counts below are control assessments, not attack stages: several can address the same step. The same replay with the controls in place before the incident shows where each phase would have been refused or bounded.
- 0
- Prevented
- 6
- Contained
- 5
- Not covered
How it could have been prevented
The same replay with the controls in place. Green marks where a step is refused, blue where it is bounded, and red where no control reaches it. Open a row to read the control, why it acts, and its caveat.
Replaying the ECScape demonstration / published August 2025; the run dates are not stated
1 · Instance credentials from a low-privileged container
2 Contained3 on other clouds2 · Impersonating the ECS agent
4 Not covered3 · Using the stolen task roles
4 Contained3 on other clouds4 · Disclosure and AWS's response
1 Not coveredKey facts
- The researcher started from a compromised, low-privileged task container on an ECS container instance of the EC2 launch type; its own task role denied everything
- The container requested the instance role credentials from the instance metadata service, a request that Sweet Security says CloudTrail does not log
- With the instance role, the researcher called ecs:DiscoverPollEndpoint and opened a WebSocket to the Agent Communication Service with the real agent's parameters; AWS accepted it alongside the real agent's session
- The ECS control plane pushed the task role and task execution role credentials of every task with a role on the instance over the forged session
- With a stolen task role that had full S3 access, the researcher deleted a demo S3 bucket; with a stolen task execution role, the researcher read the demo secret db-secret
- Sweet Security reported the issue to AWS in July 2025; AWS called it a design consideration of ECS on EC2, issued no CVE or bulletin and updated its documentation, and a CVE ID had been requested as of August 8, 2025
Sources
Every fact in this breakdown comes from the public reporting below. The replay is a model of that reporting, not a reconstruction of the environment it describes.
- 1.ECScape: Understanding IAM Privilege Boundaries in Amazon ECSSweet Security · Aug 6, 2025 · Researchthreat model, instance role credentials from the instance metadata service, poll endpoint discovery, identifier gathering, the forged agent session, task role and task execution role credentials, demo outcomes (S3 bucket deletion, secret read), Fargate not affected, CloudTrail visibility, mitigations, AWS's response
- 2.Under the Hood of Amazon ECS on EC2: Agents, IAM Roles, and Task IsolationSweet Security · Aug 6, 2025 · ResearchECS agent internals, the two instance role permissions, the Agent Communication Service, how task credentials reach tasks, the July 2025 report to AWS, AWS's classification, AWS's documentation changes
- 3.Security considerations for running containers on Amazon ECSAmazon Web Services (AWS Security Blog) · Aug 1, 2025 · AdvisoryAWS's position on container and instance boundaries, the July 9 and August 1, 2025 updates, Fargate isolation, workload separation advice
- 4.ECS-cape – Hijacking IAM Privileges in Amazon ECSfwd:cloudsec North America 2025 (pretalx schedule) · Jun 30, 2025 · Researchthe earlier public talk, the abstract's claims
- 5.ECS on EC2: Covering Gaps in IMDS HardeningLatacora · Oct 2, 2025 · ResearchIMDS blocking by network mode, the hop limit gap for awsvpc and host tasks, the host mode impasse, AWS's documentation update as reported
- 6.ECScape: New AWS ECS flaw lets containers hijack IAM roles without breaking outCSO Online · Aug 8, 2025 · NewsAWS not responding to the outlet, CVE requested, researcher quotes on default settings and Fargate, Black Hat USA 2025 presentation
The estate in the replay follows the researchers' description of their own test environment. Verdicts describe what a control does when it is in place before the run. They are not an assessment of any company's security program.