Skip to main content
Back
DemonstrationAWS
6 min read

Datadog Security Labs' whoAMI image name confusion test on AWS

Environment
Datadog Security Labs' own AWS accounts, and AWS internal non-production systems in a test coordinated with AWS security
When
Pattern found August 2024; test dates not stated – Sep 19, 2024Disclosed Feb 12, 2025
Entry
Look-alike machine images published to the public catalog, picked by lookups that match an image name with no owner and take the newest result.

Datadog Security Labs found that an image lookup by name, with no owner set and the newest match taken, also returns community images that any account can publish. In coordination with AWS security, the researchers published two benign replicas of the newest official Amazon Linux 2 images, and CloudTrail recorded EC2, acting as an AWS service, creating volumes from their snapshots tens of thousands of times, which Datadog reads as AWS internal non-production systems pulling them; AWS fixed the issue on September 19, 2024 and says only the researchers used the technique. In the researchers' own account, an AWS Labs EC2 tool picked a renamed public copy over the official image, and AWS released the Allowed AMIs setting on December 1, 2024.

What the demonstration did

Internet
EC2 APIimage lookups
Researchers' AWS accounts
Community AMIs
EC2 public image catalog
+ image consumer not named
+ non-production
+ no customer data, per AWS
AWS internal systems
Datadog Security Labs
AWS Labs EC2 tool
Look-alike replicas
Renamed public copy
Official Amazon Linux 2

Replaying Datadog's whoAMI demonstration / published February 2025; the test dates are not stated

  1. 1

    Look-alike images

    Not dated · on or before Oct 10, 2024

    In coordination with AWS security, the researchers publish two benign public replicas of the newest official Amazon Linux 2 images; they also publish a renamed copy for a tool test and share a backdoored image privately with one account they control.

  2. 2

    AWS internal systems

    Not dated · on or before Oct 10, 2024

    EC2, recorded as an AWS service, creates volumes from the replicas' snapshots tens of thousands of times; Datadog concludes an attacker's image would have run code there, and the sources name no system and state no instance launch.

  3. 3

    An AWS open-source tool

    Not dated

    In the researchers' own account, an AWS Labs EC2 tool that picks images by name with no owner check uses the renamed public copy instead of the official image.

Impact

No attacker was involved: Datadog reads tens of thousands of logged events as AWS internal non-production systems pulling the benign replicas, and concludes an attacker's image would have run code there; AWS says the systems had no access to customer data.

Outcome

What whoAMI shows about your image lookups

A lookup that matches an image name, sets no owner and takes the newest result also returns community images from any account, so a newer image with a matching name that anyone publishes can be picked. On your AWS accounts, a declarative policy whose Allowed Images Settings admit only the amazon alias and your organization's accounts keeps other accounts' public and shared images out of lookups and refuses launches from them. It never restricts the images an account owns, the amazon alias also admits verified providers, and the setting became available on December 1, 2024, after the test. AWS also recommends that you specify the owner whenever you retrieve an image ID.

Would the controls have stopped it?

In hindsight, no control would have stopped it. 2 controls would have limited how far it went. 1 step has 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
2
Contained
1
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.

Internet
EC2 APIimage lookups
Researchers' AWS accounts
Community AMIs
EC2 public image catalog
+ image consumer not named
+ non-production
+ no customer data, per AWS
AWS internal systems
Datadog Security Labs
AWS Labs EC2 tool
Look-alike replicas
Renamed public copy
Official Amazon Linux 2

Replaying Datadog's whoAMI demonstration / published February 2025; the test dates are not stated

1 · Look-alike images

1 Not covered3 on other clouds

2 · AWS internal systems

1 Contained3 on other clouds

3 · An AWS open-source tool

1 Contained3 on other clouds

Key facts

  • Datadog Security Labs identified the pattern in August 2024: an image lookup by name, with no owner set, that takes the most recent match and then launches from it
  • In coordination with AWS security, the researchers published two public replicas of the newest official Amazon Linux 2 images; CloudTrail then recorded tens of thousands of events of EC2, as an AWS service, creating volumes from their shared snapshots
  • AWS acknowledged the report on September 16, 2024 and fixed the issue on September 19; on October 7 it stated, as the researchers summarize it, that the affected systems were non-production with no access to customer data, and the researchers removed the replicas on October 10
  • An AWS Labs EC2 tool used the researchers' renamed public copy instead of the official image; the maintainers' advisory of February 7, 2025 rated the flaw Low (CVSS 3.1 base score 3.1), and version 0.11.0 checks the image owner
  • AWS released Allowed AMIs on December 1, 2024: an account-wide setting, disabled by default, that limits the discovery and use of public and shared images to permitted owners
  • Datadog estimated that roughly 1 percent of the organizations it monitors were vulnerable; AWS said its logs showed that only the researchers used the technique

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. 1.
    whoAMI: A cloud image name confusion attackDatadog Security Labs · Feb 12, 2025 · Researchlookup pattern and its conditions, publishing of look-alike images, controlled demonstration, replica images pulled by AWS internal systems, awslabs tool test, disclosure timeline, prevalence, AWS statement, Allowed AMIs, Terraform provider change, recommendations
  2. 2.
    AWS Simple EC2 CLI does not explicitly validate AMI owner (GHSA-fg2w-j28v-fc73)AWS Labs (GitHub security advisory) · Feb 7, 2025 · Advisoryawslabs tool flaw, affected and patched versions, severity, fix
  3. 3.
    Amazon EC2 introduces Allowed AMIs to enhance AMI governanceAmazon Web Services · Dec 1, 2024 · Vendor reportAllowed AMIs release date, scope, audit mode, default state, organization-wide management
  4. 4.
    whoAMI attacks give hackers code execution on Amazon EC2 instancesBleepingComputer · Feb 13, 2025 · NewsAWS statement as relayed, attacker prerequisites as reported

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.

More cloud attack breakdowns

All breakdowns